Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to install python packages for brew installed pythons

I just finished installing the latest stable version of python via Homebrew.

$ brew install python3

Everything works fine. I would like to install packages, for example PyMongo. I don't have pip.

$ pip -bash: pip: command not found

and there is no Homebrew formulae for it:

$ brew install PyMongo

brew install PyMongo Error: No available formula for pymongo Searching formulae... Searching taps...

Any idea what's the best way to install PyMongo on OS X when Python was installed via Homebrew. Thank you!

like image 227
Zoltan King Avatar asked Mar 11 '15 15:03

Zoltan King


1 Answers

Use pip3. The "caveats" text you see when you run brew info python3 was printed for you after python3 was installed; that text is frequently helpful! It reads:

You can install Python packages with

pip3 install <package>

They will install into the site-package directory

/usr/local/lib/python3.4/site-packages

like image 180
Tim Smith Avatar answered Nov 14 '22 21:11

Tim Smith