I am using MacOS 10.11 and in addition to the native Python installation I have installed Python and Pip through MacPorts. python
and pip
are linked against the respective MacPorts versions.
However, when installing a package via
sudo pip install <my-package>
a specific .so
file of that package is linked against the native Python executable. More precisely the output of otool -L
on that .so
file is
/System/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.5)
whereas the MacPorts version of Python resides at
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/
How can I force Pip to use the correct Python version to link against?