lundi 12 janvier 2015


I use MacPorts to manage certain *nix packages on my Mac. One such Mac has multiple Python versions installed.


When I switch between Python versions, I use a command like:



port select --set python python27-apple


to set the default python to the Python 2.7 that my Mac shipped with from Apple, as described here.


However, MacPort's select command doesn't change any of the utilities that use python, such as easy_install.


This means that regardless of which Python is active, the supporting utilities are always the system default ones:



bash-3.2$ which python
/opt/local/bin/python
bash-3.2$ port select --show python
The currently selected version for 'python' is 'python27'.
bash-3.2$ which easy_install
/usr/bin/easy_install
bash-3.2$ ls /opt/local/bin/easy_install-*
/opt/local/bin/easy_install-2.7 /opt/local/bin/easy_install-3.4


Notice that installing a Python version with MacPorts brings along its easy_install command, but switching to that python using port select --set python27 does not also set /opt/local/bin/easy_install-2.7.


This leads to confusing errors where the wrong version of Python was used to install packages.


Thus, my question:


How can I instruct MacPorts to make appropriate symlinks for Python's additional utilities, not just the single python command?





Aucun commentaire:

Enregistrer un commentaire