Why is pip asking me to upgrade when it's already up-to-date?

爷,独闯天下 提交于 2021-01-03 06:11:53

问题


I have a brand new installation of python 3.7.1 64-bit and I'm using the latest pyCharm as my IDE. I have no other installation of python on this machine.

I go to install numpy and I get this message:

(venv) C:\Users\John\PycharmProjects\project>pip install numpy
Requirement already satisfied: numpy in c:\users\john\pycharmprojects\pysims\venv\lib\site-packages (1.15.4)
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

So I run the suggested command but it's already up-to-date

(venv) C:\Users\John\PycharmProjects\project>python -m pip install --upgrade pip
Requirement already up-to-date: pip in c:\users\john\pycharmprojects\pysims\venv\lib\site-packages (18.1)

So I check the version but it's still the old version

(venv) C:\Users\John\PycharmProjects\pySIMS>pip -V
pip 10.0.1 from c:\users\john\pycharmprojects\pysims\venv\lib\site-packages\pip-10.0.1-py3.7.egg\pip (python 3.7)

I thought I'd try py -3 to upgrade and it works.

(venv) C:\Users\John\PycharmProjects\pySIMS>py -3 -m pip install --upgrade pip
Collecting pip
  Using cached https://files.pythonhosted.org/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37/pip-18.1-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 10.0.1
    Uninstalling pip-10.0.1:
      Successfully uninstalled pip-10.0.1
Successfully installed pip-18.1

But the version is still old

(venv) C:\Users\John\PycharmProjects\pySIMS>pip -V
pip 10.0.1 from c:\users\john\pycharmprojects\pysims\venv\lib\site-packages\pip-10.0.1-py3.7.egg\pip (python 3.7)

WHAT IS GOING ON? Am I missing something totally obvious? I've never had an issue like this working in Python 2 but since I've moved to Python 3 it's been nothing but errors.


回答1:


This is looking like you have multiple installation of pip, one that comes first in the PATH (pip) and another that is recognized by python (python -m pip). Try running the command:

pip show pip

and

python -m pip show pip

And check if the path are the same. If not i would suggest uninstalling the undesired one, or change your your PATH environment variable to have the folder containing the correct pip come before the folder with the wrong one.




回答2:


When I got this error I had 2 pip version folders in site-packages. One pip-19.2.3.dist-info and another something like pip-10.0.1. I deleted the first one, leaving only the default version. Then running python -m pip install --upgrade pip fixed the problem




回答3:


1.Open you project setting(File>Settings)
2.Project>Project Interpreter
3.find pip and lick the triangle on the right(in the red circle I draw)



来源:https://stackoverflow.com/questions/53661293/why-is-pip-asking-me-to-upgrade-when-its-already-up-to-date

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!