Python update in virtual Env

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 environment using

virtualenv python3.0

and then activate it using

source python3.0/bin/activate

If I upgrade python in virtualenv, will it leave my system python untouched? If so, am I just installing python 3 using pip install?

+3
source share
2 answers

When creating through

virtualenv python3.0

Creates a symbolic link in the bin directory of the virtual env folder:

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

This way you cannot just install pip to upgrade python.

On mac osx, you can install multiple versions of python. In your case, install Python 3.0, and then use this version to invoke virtualenv.

Python /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.

env python 3.0

+4

pythonbrew, python :

pythonbrew - Python $HOME.

+1

Source: https://habr.com/ru/post/1764774/


All Articles