2

Recently I installed Python 3.3 using the Mac OSX installer. Following which I installed pip-3.3 following the instructions of How to use pip with Python 3.x besides Python 2.x, the second answer. After which I ran the following command to install virtualenv,

sudo pip-3.3 install virtualenv

Updated my PATH variable as well as follows:

/Library/Frameworks/Python.framework/Versions/3.3/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/local/share/python:/usr/local/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin

PYTHONPATH variable is as follows:

/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages:/Library/Frameworks/Python.framework/Versions/3.3/bin:/Library/Python/2.7/site-packages:/usr/local/lib/python2.7/site-packages:

However, when I run virtualenv -p /usr/local/bin/python3 py3, I get the following Error message.

I observed that, on many posts and questions answered on StackOverflow as well, the usage is always -p /usr/bin/python3 however in my case there is no directory like python3 in /usr/bin/. There's one in /usr/local/bin/. Is this strange and incorrect?

Kindly help me out here. How should I go about it? And what am I doing wrong here?

Thanks,
Chintak

Community
  • 1
  • 1
Chintak
  • 365
  • 4
  • 14
  • You should not need to modify any environment variables just to get virtualenv working. My guess is that your change means two different versions of virtualenv or pip get's mixed up. Undo the environment changes and try again. – Lennart Regebro Aug 01 '13 at 17:53
  • @LennartRegebro so use ``/Library/Python/2.7/site-packages:/usr/local/lib/python2.7/site-packages:`` as `PYTHONPATH` ? I even have Python 2.7 installed. If I set the above as `PYTHONPATH` it tries to search in `site-packages` of 2.7. – Chintak Aug 01 '13 at 17:59
  • I think the error lies in `virtualenv` trying to install `pip`. My `pip` command points to `pip` for Python 2.7. `pip-3.3` points to pip for Python 3.3. Could this be the problem? – Chintak Aug 01 '13 at 18:01
  • In a normal install, you do not have PYTHONPATH set at all. No, it's not a problem, just use pip-3.3 when you want to install for Python 3.3. – Lennart Regebro Aug 01 '13 at 20:34
  • http://regebro.wordpress.com/2011/02/02/newbie-hint-on-installing-python-and-its-modules-and-packages/ – Lennart Regebro Aug 01 '13 at 20:35

0 Answers0