22

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?

2
  • How about installing pip via homebrew and then installing pymongo via pip? Commented Mar 11, 2015 at 15:25
  • Well, I'm not sure if this is the best way but I managed to install it with: $ python3 -m easy_install pymongo Commented Mar 11, 2015 at 16:22

2 Answers 2

13

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

Sign up to request clarification or add additional context in comments.

1 Comment

With up-to-date brew and python3, trying this gives an "error: externally-managed-environment" error. See stackoverflow.com/questions/75608323/… for details.
0

How to install Python packages for brew installed Pythons?

Some Python packages can be installed via Brew, e.g.:

brew install python-setuptools 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.