views:

43

answers:

1

I have python 2.6.1 installed on Mac OS X. I wanted to play around with python 3.2, so i created a virtual enviromant using

virtualenv python3.0

and then activated it using

source python3.0/bin/activate

if I update the python in the virtualenv will it leave my system python untouched? If yes, do I just install python 3 using pip install?

+1  A: 

When you create through

virtualenv python3.0

It creates a symlink in the virtual env folder bin directory :

lrwxr-xr-x   1 ---  ---     6 Aug 23 13:28 python2.6 -> python

So you can not do just pip install to upgrade python.

On mac osx, you can have multiple versions of python installed. In your case , install Python 3.0 and then use that version to call the virtualenv.

Python is installed in /usr/bin

-rwxr-xr-x  2 root  heel  86000 Feb 11  2010 python
-rwxr-xr-x  5 root  heel    925 Feb 11  2010 python-config
lrwxr-xr-x  1 root  heel     75 Aug 23 10:01 python2.5 -> ../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5
lrwxr-xr-x  1 root  heel     82 Aug 23 10:01 python2.5-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5-config
lrwxr-xr-x  1 root  heel     75 Aug 23 10:01 python2.6 -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6
lrwxr-xr-x  1 root  heel     82 Aug 23 10:01 python2.6-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/python

/usr/bin/python3.0 virtualenv yourenv.

This env will have a symlink for python 3.0

pyfunc
So I should first use `sudo pip install python 3.2` or using the .dmg installer and Mac OS X will install it side by side with 2.6? And then create the virtualenv as you said?
Ali
Use DMG installer for Python Install. Use PIP install to install packages. Thats how I do it.
pyfunc