Closed wesinator closed 4 years ago
We don't install /usr/local/bin/pip
and haven't for some time now:
$ ls -l /usr/local/bin/pip
gls: cannot access '/usr/local/bin/pip': No such file or directory
We only offer pip3
.
Anything we install in /usr/local/bin/
is a symlink anyway like /usr/local/bin/pip3 -> ../Cellar/python@3.8/3.8.4/bin/pip3
. If this is not the case, then it is likely not Homebrew which put it there.
Python versions should really just install updates under one directory , but until they do, IMO package management should handle the transition of site packages.
Python does not provide ABI compatibility so this is not universally possible and some packages really do require to be reinstalled.
Dependencies of a package can also vary between Python versions.
Ok thanks, that makes sense.
I guess I need to be more careful before running brew upgrade
:D
The right way to create pip bin persistently is to do ln -s /usr/local/bin/pip3 /usr/local/bin/pip
Adding /usr/local/opt/python/libexec/bin
to your PATH is also an option, which provides unversioned pip
, python
, etc.
Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.
brew update
and can still reproduce the problem?brew doctor
, fixed all issues and can still reproduce the problem?brew config
andbrew doctor
and included their output with your issue?What you were trying to do (and why)
brew upgrade to upgrade packages including python3 (was at python3.7.7)
What happened (include command output)
python3 upgraded from 3.7.7 to 3.8.4
pip
command is broken and pip packages that were installed in python3.7 were not transferred to the new python version (3.8.4).$ pip -bash: /usr/local/bin/pip: /usr/local/opt/python/bin/python3.7: bad interpreter: No such file or directory
which pip : /usr/local/bin/pip
which python3: /usr/local/bin/python3
which python3.8 : /usr/local/bin/python3.8
python3.7 binaries seems to have been totally removed
Command output
What you expected to happen
Step-by-step reproduction instructions (by running
brew
commands)starting with python3.7.7 and pip set up
brew upgrade
to get python 3.8.4then run
pip
:$ pip -bash: /usr/local/bin/pip: /usr/local/opt/python/bin/python3.7: bad interpreter: No such file or directory
pip3 list
| grep <previously installed package>
The packages that were installed (under /usr/local/lib/python3...) are no longer found in the new python3.8 directory
Python versions should really just install updates under one directory , but until they do, IMO package management should handle the transition of site packages.
This issue has come up in the past #1727
Output of
brew config
andbrew doctor
commands