简体   繁体   English

尝试升级pip,但错误'WinError 5'出现了

[英]Tried to upgrade pip, but error 'WinError 5' showed up

I've found a problem with pip and can't do anything with it anymore. 我发现pip存在问题,不再对它做任何事情了。 I'm on a Windows 7 computer and have a Dutch language (maybe it will occur problems with reading) 我在Windows 7计算机上并使用荷兰语(可能会出现阅读问题)

I did use pip version 8.1.1, but there's a newer version, 9.0.1. 我确实使用了pip版本8.1.1,但是有一个更新的版本,9.0.1。 I installed it using 'pip install --upgrade pip' and he's doing pretty well so it uninstalled the previous version of pip and then the problem came. 我使用'pip install --upgrade pip'安装它并且他做得非常好,所以它卸载了以前版本的pip然后出现了问题。 Now I can't use pip as well. 现在我也不能使用pip。 When I try to install or upgrade my system says: 'ImportError: No module named pip'. 当我尝试安装或升级我的系统时说:'ImportError:没有名为pip的模块'。

I had this problem somewhere in 2016 and never found an answer, so I installed Python again on my computer. 我在2016年的某个地方遇到过这个问题并且从未找到答案,所以我再次在我的计算机上安装了Python。 I hope there's a better way to do this instead of install whole Python and all those modules again. 我希望有更好的方法来做到这一点,而不是再次安装整个Python和所有这些模块。

So for me is this a bit strange, I hope anyone know this problem and knows a way to fix this. 所以对我来说这有点奇怪,我希望有人知道这个问题,并知道解决这个问题的方法。 Beneath I'll show up the texts in the command prompt. 在下面,我将在命令提示符下显示文本。

Code: 码:

You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' comm
and.

D:\PythonProjects\Python Crash Course\learning_log\ll_env\Scripts>pip install --
upgrade pip
Collecting pip
  Using cached pip-9.0.1-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 8.1.1
    Uninstalling pip-8.1.1:
Exception:
Traceback (most recent call last):
  File "C:\Users\Pascal\AppData\Local\Programs\Python\Python35\lib\shutil.py", l
ine 538, in move
    os.rename(src, real_dst)
OSError: [WinError 17] Het systeem kan het bestand niet verplaatsen naar een and
er station: 'd:\\pythonprojects\\python crash course\\learning_log\\ll_env\\scri
pts\\pip.exe' -> 'C:\\Users\\Pascal\\AppData\\Local\\Temp\\pip-0hagtsau-uninstal
l\\pythonprojects\\python crash course\\learning_log\\ll_env\\scripts\\pip.exe'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "d:\pythonprojects\python crash course\learning_log\ll_env\lib\site-packa
ges\pip\basecommand.py", line 209, in main
  File "d:\pythonprojects\python crash course\learning_log\ll_env\lib\site-packa
ges\pip\commands\install.py", line 317, in run
  File "d:\pythonprojects\python crash course\learning_log\ll_env\lib\site-packa
ges\pip\req\req_set.py", line 726, in install
  File "d:\pythonprojects\python crash course\learning_log\ll_env\lib\site-packa
ges\pip\req\req_install.py", line 746, in uninstall
  File "d:\pythonprojects\python crash course\learning_log\ll_env\lib\site-packa
ges\pip\req\req_uninstall.py", line 115, in remove
  File "d:\pythonprojects\python crash course\learning_log\ll_env\lib\site-packa
ges\pip\utils\__init__.py", line 267, in renames
  File "C:\Users\Pascal\AppData\Local\Programs\Python\Python35\lib\shutil.py", l
ine 553, in move
    os.unlink(src)
PermissionError: [WinError 5] Toegang geweigerd: 'd:\\pythonprojects\\python cra
sh course\\learning_log\\ll_env\\scripts\\pip.exe'

D:\PythonProjects\Python Crash Course\learning_log\ll_env\Scripts>pip freeze > r
equirements.txt
Traceback (most recent call last):
  File "C:\Users\Pascal\AppData\Local\Programs\Python\Python35\lib\runpy.py", li
ne 184, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\Pascal\AppData\Local\Programs\Python\Python35\lib\runpy.py", li
ne 85, in _run_code
    exec(code, run_globals)
  File "D:\PythonProjects\Python Crash Course\learning_log\ll_env\Scripts\pip.ex
e\__main__.py", line 5, in <module>
ImportError: No module named 'pip'

This is related to disk drives on Windows. 这与Windows上的磁盘驱动器有关。 Pip downloads the new files to your current drive ( D: ) and then tries to move them over to the system files (on C: ) and fails. Pip将新文件下载到当前驱动器( D: :),然后尝试将它们移动到系统文件(在C: :)上并失败。

(See https://github.com/pypa/pip/issues/2824 ) (见https://github.com/pypa/pip/issues/2824

Could you run 你能跑吗?

python -m pip install -U pip

or is pip completely gone? 还是pip完全消失了?

If it's gone then you would have to re-install it. 如果它已经消失,那么你将不得不重新安装它。 Maybe re-installing all of Python is easier although probably more time consuming. 也许重新安装所有的Python更容易,虽然可能更耗时。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 pip 随机安装,但出现了 - pip install random but this showed up 升级 pip 失败:尝试了“python -m pip install --upgrade pip” - upgrade pip fail: "python -m pip install --upgrade pip" was tried 我尝试使用 pip install django 安装 django,后来我升级 pip 时出错,我完成了升级 pip,但仍然出现如下我提到的错误 - I tried to install django using pip install django, later i get error to upgrade pip, i done upgrade pip, but still got error as below i mentioned 升级 Pip 错误信息 - Upgrade Pip error message “pip install --upgrade distribute”出错 - Error on “pip install --upgrade distribute” 通过“ pip install --upgrade”升级pip和scrapy后的pip错误 - pip error after upgrading pip & scrapy by “pip install --upgrade” 点错误:应升级点,熊猫和matplotlib,但返回错误 - Pip error:should upgrade pip, pandas and matplotlib but returns error pip install --upgrade pip 和 pip install --upgrade setuptools 均失败,错误代码为 1 - pip install --upgrade pip and pip install --upgrade setuptools both failed with error code 1 使用命令“pip3 install --upgrade pip”升级 pip 后出错 - Error after pip upgrade using command “pip3 install --upgrade pip” 尝试升级pip时出现致命的Python错误 - Fatal Python error when attempting to upgrade pip
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM