Can’t load Python modules installed via pip from site-packages directory

/usr/bin/python is the executable for the python that comes with OS X. /usr/local/lib is a location for user-installed programs only, possibly from Python.org or Homebrew. So you’re mixing different Python installs, and changing the python path is only a partial workaround for different packages being installed for different installations.

In order to make sure you use the pip associated with a particular python, you can run python -m pip install <pkg>, or go look at what the pip on your path is, or is symlinked to.

Leave a Comment