4

I installed Python 3 with Homebrew and a tool I was installing through Homebrew auto-installed Python 2.x. So, I have both and pip (etc) is installed for both, unlike the macOS default Python.

Python tools that I download through Homebrew/Core work fine. Anything I install through pip, pip2, pip3 gives me a bash response of "command not found".

ImgurDownloader
-bash: ImgurDownloader: command not found

ImgurDownloader -h
-bash: ImgurDownloader: command not found

Pip, itself, finds these tools installed without issue and believes they are all set up and ready to go.

pip show ImgurDownloader 
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Name: ImgurDownloader
Version: 1.0
Summary: Download and discover imgur albums
Home-page: https://github.com/tiberiuichim/imgur-album-recursive-downloader
Author: Tiberiu Ichim
Author-email: tiberiu.ichim@gmail.com
License: GPL3
Location: /usr/local/lib/python2.7/site-packages
Requires: xdg, click, awesome-slugify, requests
Required-by: 

The problem is not restricted to the tool used as an example above; it happens with every pip installed tool.

What's going on? Are the two Pythons crossing wires? Is there something missing from my path?


/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:~/Developer:/usr/local/ardua:/Applications/LibreOffice.app/Contents/MacOS/soffice:/usr/local/sbin:/usr/local/opt/ncurses/bin:/usr/local/opt/nss/bin:~/Library/Python/2.7/bin:~/Library/Python/2.7/lib/python/site-packages:/usr/local/opt/python2/bin:/usr/local/opt/python2/libexec:/usr/local/lib/python2.7/site-packages:/Library/Python/2.7/site-packages:/usr/local/opt/sphinx-doc/bin

I can't figure out how to fix this because I don't understand what's broken.

  • There’s a lot to unpack with python since the transition is in full swing and not all packages have (or will) make the transition - docs.brew.sh/Homebrew-and-Python – bmike Apr 7 at 15:40
  • 1
    I've edited to include the output responses I get. – Kerlix Apr 7 at 15:48
  • 1
    Cool - so that library isn't on pip3 - so you'll want to run python2 and see if it can import the module. It could still be path or version or just the install failed. When I'm back at a Mac I'll poke a little more - I'm confident someone will be able to reproduce this, though with the extra detail if they don't just know the answer based on usage... – bmike Apr 7 at 15:59
  • 1
    Use conda for managing python packages then pip under that - makes life simpler.:) Or download all python packages through Homebrew and don't use pip ;) OK to debug - Now in this case what is the path you have to pip pip2 and pip3 and what is the #! line in each of them – Mark Apr 7 at 16:03
  • 2
    How about this: setup a virtual environment and using python distribution from homebrew and make sure you set --no-site-packages so that it wont use the system packages. Then from that virtual environment do a pip3 install whatever you need. In other words: virtualenv -p /path/to/homebrew/python3 --no-site-packages foo. Then source foo/bin/activate and finally pip3 isntall bar – Pouya Apr 11 at 13:15

You must log in to answer this question.

Browse other questions tagged .