Quote: Installing packages not in macports

> When installing packages not in MacPorts, first make sure that you remove your .pydistutils file if you have one, then simply use:
> python setup.py install –user

> (do not omit –user and do not use sudo). This will place user installed packages in ~/Library/Python/2.7/lib/python/site-packages where they will automatically be picked up by the Python installation, without messing up the MacPorts file structure. Note that you can also install packages in a similar way using easy_install-2.7 and pip-2.7 by specifying the –user option.
> The reason for installing packages with –user is that if instead you install packages using sudo python setup.py install, the packages will be installed inside the MacPorts tree, but MacPorts won’t be aware of it, so this could cause issues in future if the package is installed via MacPorts. As a rule of thumb, don’t ever install anything into /opt/local/ other than via the port command. If you did mistakenly install packages to the MacPorts directory, just go to /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages and remove the files relating to the package you installed.

From [AstroFrog’s directions](http://astrofrog.github.io/macports-python/)

Leave a Reply