gpt4 book ai didi

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

转载 作者:可可西里 更新时间:2023-11-01 09:36:38 26 4
gpt4 key购买 nike

我发现 pip 有问题,无法再用它做任何事情。我使用的是 Windows 7 计算机并且会说荷兰语(可能会出现阅读问题)

我确实使用了 pip 版本 8.1.1,但是有一个更新的版本,9.0.1。我使用“pip install --upgrade pip”安装它,他做得很好,所以它卸载了以前版本的 pip,然后问题就来了。现在我也不能使用 pip。当我尝试安装或升级我的系统时,提示:“ImportError:没有名为 pip 的模块”。

我在 2016 年的某个地方遇到过这个问题,但一直没有找到答案,所以我在我的电脑上重新安装了 Python。我希望有更好的方法来执行此操作,而不是重新安装整个 Python 和所有这些模块。

所以对我来说这有 pip 奇怪,我希望任何人都知道这个问题并且知道解决这个问题的方法。下面我将在命令提示符中显示文本。

代码:

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'

最佳答案

不确定有多少人会被这篇文章吸引,但是,如果您发现自己处于 pip 安装、PyCharm 安装中的终端、Python 包安装等方法无法正常工作并且您收到错误的情况pygame 已安装在 Conda 中,但模块无法在 PyCharm 中识别;这很可能是由于安装了冲突的 Python 版本,因为 PyCharm 和 Conda 都是 IDE,您可以安装重叠的 Python 版本。

如果是这种情况,您将需要卸载所有版本的 Python 和 Anaconda 以及 PyCharm。然后一旦重新安装,如果 PyCharm 没有将自己识别为 Python 解释器,则添加解释器并作为虚拟环境运行。在此阶段,您应该能够使用 python 包部分毫无问题地安装 PyGames。您也许可以在不卸载其他 IDE 的情况下通过,但我发现完全清除是充分的证据。

希望对你有帮助

关于python - 尝试升级 pip,但出现错误 'WinError 5',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41782175/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com