WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip. Please see https://github.com/pypa/pip/issues/5599 for advi
I also faced the same problem when I switched to zsh shell from bash.
The solution was simple but I didn't notice it at first.
After I installed pip, I saw this warning
pip is being invoked by an old script wrapper
First I tried this solution
python3.8 -m pip install --upgrade --force-reinstall pip
But then I ran into this issue:
Then I searched how to add PYTHONPATH
. I opened my .zshrc
and say these lines were commented
# If you come from bash you might have to change your $PATH.
I uncommented the line that followed, and my misery vanished.
Now when I ran,
python3.8 -m pip install --upgrade --force-reinstall pip
Then the warnings of not in path
disappeared in thin air, leaving me with a clean output.
I hope this would help anybody who ran into the same problem.
I faced the same issue but on Windows. Reinstalling pip
worked for me. You can force a reinstall of pip
with:
python -m pip install --upgrade --force-reinstall pip
Let me preface this by saying I am still very green with python and linux in general so I may be off base with my guidance here but I digress...
You might want check the location of the pip
module you are invoking when you use the pip
command. for me, I found out that when I would update and modify the pip
command, it would update the pip
file on my ~/.local/bin
directory but when I would run it, it would default to the pip
command located in the /usr/local/bin
directory.
run the command
pip install --upgrade pip
for me this command returned:
Defaulting to user installation because normal site-packages is not writeable Requirement already up-to-date: pip in ./.local/lib/python3.6/site-packages (20.1.1)
Note the file location and version (in bold).
check your path variables and the default pip that executes default by running the these 2 commands respectively
echo $PATH
and
which pip
god willing, they'll be congruent otherwise you'll have to either alter your the path variable directories making sure that the directory for your desired pip module is first or you'll have to delete the pip file from the director that you dont want use (i.e. the directory that came up when you ran which pip if that is not the same as the directory listed when you updated pip)
For me, removing the pip files in the usr/local/bin
worked like a charm. Also check that the pip files that you want to use are referencing the correct version of python at the top of their scripts
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal.cli.main import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())
The other file originally referenced usr/bin/python (Python 2.7) instead of usr/bin/python3 (python 3.6.9) as I wanted initially.
Like I said before, I am just getting started with linux and python so take this with a grain of salt. Nevertheless, I no longer get this pip warning after taking these steps. Let me know if this helps at all.
I've encountered the same problem after I updated pip to 20.1.x version through Pycharm. I've found one way to ensure that you can use pip install xxx
in emergency case:
C:\Program Files\Python37\Lib
in my win10 laptop)./pip19_xxx
for your old one and ./pip
for the newly installed one./pip
)pip install xxx
or python -m pip install xxx
in cmd
, it should work by nowJust use
python -m pip install [module_name]
This will resolve warning issue
You can solve it by upgrading pip
:
pip install --upgrade pip