To summarize above, install pip using Macports using
sudo port install py27-pip
leads to the installation of a package named py27-pip.
However, neither /opt/local/bin/pip
and port select pip
or port select py27-pip
both refused (unlike port select python
). Changing the settings in the bin
another distribution is usually not recommended.
Note that /usr/bin
python links point to Apple's pre-installed python, /usr/local/bin
points to those installed by MacPython from python.org , whereas /opt/local/bin
where Macports sets its links. Actual library settings can be found with ls -ls
applied to different python files in each bin
).
To ensure that Macports files are called, export the path for Macports last in .bash_profile
. For example, if you installed Macports and then installed the binary distribution from python.org, you will end your path with it later ~/.bash_profile
, so it will be the first in the path variable, and Macpython will obscure Macports.
After ensuring that the paths are installed correctly, the system still does not find the pip
command in the Macports bin
because it is installed as pip-2.7
and pip
is automatically created.
As a result, the system continues to search for the path and, if, for example, Macpython is added to the path later and installs pip, after which pip appears.
This can be avoided with the command suggested above:
sudo ln -s /opt/local/bin/pip-2.7 /opt/local/bin/pip
Ioannis filippidis
source share