Skip to content Skip to sidebar Skip to footer

Pip Packages Not Found - Brewed Python

Running Python 2.7.3, installed with HomeBrew, on a mac. Installed several packages using PIP, including virtualenv. (Using virtualenv as an example, but NONE of the packages work.

Solution 1:

The problem was that I had not added Python to the system $PATH.

At the end of the brew install it says (viewable by typing brew info python):

Executable python scripts will be put in:  
   /usr/local/share/python
so you may want to put "/usr/local/share/python"in your PATH, too.

So, simply had to open .profile and paste it in, and all packages work.

Much thanks to MistyM on the Brew IRC channel for pointing that out!

Solution 2:

Download virtualenv.py if your system does not provide virtualenv command:

curl -L -o virtualenv.py https://raw.github.com/pypa/virtualenv/master/virtualenv.py

First create your virtualenv folder:

 python virtualenv.py venv # venv <-- name of the folder

You need run virtualenv's activate in shell:

 . venv/bin/activate

or

source venv/bin/activate

This fixes PYTHONPATH and PATH. You do this once per each shell session. Then python command will magically work :)

Now run pip, packages will be installed in venv.

More info (disclaimer, I am the author) http://opensourcehacker.com/2012/09/16/recommended-way-for-sudo-free-installation-of-python-software-with-virtualenv/

Solution 3:

Quick work flow on creating a Virtual env

$ mkdir awesomeapp$cd awesomeapp$virtualenv venv --distribute
New python executable in venv/bin/python
Installing distribute.........done.
Installing pip................done.
$source venv/bin/activate(venv)$python

One you CD into your directory that's when you're creating your virtual venv folder to store your path.

You'll now it's active when you see the (venv)

Post a Comment for "Pip Packages Not Found - Brewed Python"