简体   繁体   中英

pip uninstalled and now I don't know what to do?

So this is what I've tried to do in Windows 10 cmd

C:\Users\lewis>pip install pandas
Collecting pandas
  Downloading pandas-1.4.1-cp310-cp310-win_amd64.whl (10.6 MB)
    ---------------------------------------- 10.6/10.6 MB 8.2 MB/s eta 0:00:00
Collecting pytz>=2020.1
  Downloading pytz-2022.1-py2.py3-none-any.whl (503 kB)
     ---------------------------------------- 503.5/503.5 KB 8.0 MB/s eta 0:00:00
Collecting numpy>=1.21.0
  Downloading numpy-1.22.3-cp310-cp310-win_amd64.whl (14.7 MB)
     ---------------------------------------- 14.7/14.7 MB 8.5 MB/s eta 0:00:00
Collecting python-dateutil>=2.8.1
  Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
     ---------------------------------------- 247.7/247.7 KB 5.1 MB/s eta 0:00:00
Collecting six>=1.5
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: pytz, six, numpy, python-dateutil, pandas
Successfully installed numpy-1.22.3 pandas-1.4.1 python-dateutil-2.8.2 pytz-2022.1 six 1.16.0'

So the module I wanted seems to have succesfully installed before I was prompted with this message.

WARNING: You are using pip version 22.0.3; however, version 22.0.4 is available.
You should consider upgrading via the 
'C:\Users\lewis\AppData\Local\Programs\Python\Python310\python.exe -m pip install --upgrade pip' command.'

So my pip is out of date woop. So I proceed to upgrade the pip.

C:\Users\lewis>pip install --upgrade pip
Requirement already satisfied: pip in 
c:\users\lewis\appdata\local\programs\python\python310\lib\site-packages (22.0.3)
Collecting pip
  Downloading pip-22.0.4-py3-none-any.whl (2.1 MB)
    ---------------------------------------- 2.1/2.1 MB 6.4 MB/s eta 0:00:00
Installing collected packages: pip
   Attempting uninstall: pip
      Found existing installation: pip 22.0.3
      Uninstalling pip-22.0.3:
         Successfully uninstalled pip-22.0.3

Then this is where it all goes wrong.

ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 
'C:\\Users\\lewis\\AppData\\Local\\Temp\\pip-uninstall-un6fh2sa\\pip.exe'
Consider using the `--user` option or check the permissions.

So it doesn't reainstall a new version of pip so I'm left with nothing. But it does still retrieve a version of pip from a file.

C:\Users\lewis>pip --version
pip 22.0.4 from C:\Users\lewis\AppData\Local\Programs\Python\Python310\lib\site-packages\pip (python 3.10)

What's happened here and how do I fix it. Not really that advanced on pip stuff. Thanks!

Is everything ok, you have numpy and pip installed and if you want to upgrade pip, just use the --user flag as is said in your own post:

pip install --upgrade --user pip

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM