Python versions gone after installing Python 3.3 through Macports

so I installed Python 3.3 via Macports using port install python33

(using OSX 10.8.2 ML)

Everything worked fine (at least it didn't give an error message at the end)

So, after that, I wanted to select this specific version of python using port selection, and first I would like to have a list of all available versions now:

port select --list python

and now it gives me a list of 3 options:

 Available versions for python: None python27 (active) python33 

before I installed python33, I also had the python versions listed:

 Available versions for python: none python25-apple python26-apple python27 (active) python27-apple 

Apple versions still exist (located at /System/Library/Frameworks/Python.framework/Versions). They are no longer listed.

Does anyone know how to handle this? (Also, when I use the python command in the shell, it still uses the python27-apple version. When I wanted to change the version earlier, an error occurred, but that would be a different question.)

EDIT (10.24.2012):

In the meantime, I found out about the team:

 port contents python_select 

which produces:

 Port python_select contains: /opt/local/etc/select/python/base /opt/local/etc/select/python/none 

In addition to what is indicated here, the folder contains these files:

 drwxr-xr-x 8 admin 272 24 Okt 09:50 . drwxr-xr-x 5 admin 170 4 Okt 15:05 .. -rw-r--r-- 1 wheel 363 23 Okt 17:18 base lrwxr-xr-x 1 admin 8 23 Okt 18:05 current -> python27 -rw-r--r-- 1 wheel 26 23 Okt 17:18 none -rw-r--r-- 1 wheel 398 23 Okt 23:27 python27 -rw-r--r-- 1 wheel 384 23 Okt 17:21 python33 

python27 and 33 is a simple text file with the following, the same content (version number is different):

 bin/python2.7 bin/pythonw2.7 bin/python2.7-config bin/idle2.7 bin/pydoc2.7 bin/smtpd2.7.py bin/2to3-2.7 share/man/man1/python2.7.1 - /opt/local/Library/Frameworks/Python.framework/Versions/2.7 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Headers /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Python 

But this. I do not know what I can do with this information ...

+4
source share
1 answer

(Also, when I use the python command in the shell, it still uses the python27-apple version. When I wanted to change the version earlier, an error occurred. But that would be a different question.)

It looks like your search path is wrong. Change your ~/.bashrc and near the end:

 export PATH=/opt/local/bin:$PATH 

If you want to have this system-wide system, edit /etc/bash.rc and put the PATH definition there. You want to put it somewhere near the end, because bash resources tend to sometimes override PATH (so if you put it at the beginning, then the likelihood that the remaining configuration will change it).

In any case, after starting the next terminal, the python command should be allowed in /opt/local/bin/ , and the python executable should contain a symbolic link to any selected version of the port.

Update. You can check which version of Python you have selected, depending on your PATH parameter, using:

 which python 

It should print

 /opt/local/bin/python 
+1
source

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


All Articles