Skip to content

Instantly share code, notes, and snippets.

@Daeinar
Created December 26, 2012 22:34
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save Daeinar/4383663 to your computer and use it in GitHub Desktop.
Save Daeinar/4383663 to your computer and use it in GitHub Desktop.
Install pip packages with homebrew
Install pip packages with homebrew:
1. Install Homebrew
http://mxcl.github.com/homebrew/
2. Install the brew-pip package
brew install brew-pip
3. Add Homebrew's pip path to your PYTHONPATH environment variable (you probably should add this to some sort of shell initialization file like ~/.bashrc or ~/.zshrc)
export PYTHONPATH=$(brew --prefix)/lib/python2.7/site-packages
3. Now install any pip pacakges with Homebrew!
brew pip Glances
@0x3bfc
Copy link

0x3bfc commented May 29, 2023

python3 -m pip install modern_robotics

works fine for me.

@coolperson789
Copy link

python3 -m pip install modern_robotics

works fine for me.

u absolute boss much love i appreciate it my bro, ur single command saved me a hell of a ton of time. thank u my brotha

@rahulroy06
Copy link

Error: brew-pip has been disabled because it is not maintained upstream!

@psnavega
Copy link

Error: brew-pip has been disabled because it is not maintained upstream!

Theres any solution?

@mattpackwood
Copy link

I noticed a number of Python libraries were added and then deleted from Homebrew in the last month or so. is there something "going on"?

@louwers
Copy link

louwers commented Mar 15, 2024

Use pipx.

pip3 install BetterADBSync
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try brew install
    xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-brew-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip.
    
    If you wish to install a non-brew packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.

@raj470
Copy link

raj470 commented Apr 27, 2024

Use pipx.

pip3 install BetterADBSync
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try brew install
    xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-brew-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip.
    
    If you wish to install a non-brew packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.

I have the same issue I tried in all other ways, but even still I'm not able to install the pip.
Any suggestions.....

@mattpackwood
Copy link

You can use Python's venv like described here.

However if you really want to install packages that way, then there are a couple of solutions:

use pip's argument --break-system-packages,
add following lines to ~/.config/pip/pip.conf:

[global]
break-system-packages = true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment