Mac OSX: Migrating to Python 2.7.3

I installed Mac OSX Python 2.7.3 and tried to switch to the new version:

$ python2.7 -V Python 2.7.3 # It was installed $ python -V Python 2.6.1 # Default is 2.6 $ export VERSIONER_PYTHON_VERSION=2.5 $ python -V Python 2.5.4 # I can switch to 2.5 $ export VERSIONER_PYTHON_VERSION=2.6 $ python -V Python 2.6.1 # And 2.6 

But:

 $ export VERSIONER_PYTHON_VERSION=2.7 $ python -V python: VERSIONER_PYTHON_VERSION environment variable error (ignored) Python 2.6.1 

Unable to switch to 2.7! Why is this?

+6
source share
3 answers

Installing python.org will put the python executable in / usr / local / bin. Apple python is located in / usr / bin

To call python python.org, you can use the full path / usr / local / bin / python or change your path to put / usr / local / bin to / usr / bin. You can still call Apple python using the full path / usr / bin / python

Some python installations, for example. Macports provides a tool that provides symbolic links to various python installations and allows you to switch between them.

+5
source

I do not think that we can switch the python version on Mac OS X without resorting to something like MacPorts or ActivePython .

+1
source

I think this is because VERSIONER_PYTHON_VERSION is specific to the python packages created by apple.

0
source

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


All Articles