我发现pip存在问题而无法再对它做任何事情了。 我在Windows 7计算机上使用荷兰语(可能会出现阅读问题)
我确实使用了pip版本8.1.1,但是有更新版本9.0.1。我使用' pip install --upgrade pip'安装它。并且他做得很好所以它卸载了先前版本的pip然后问题来了。现在我也不能使用pip。当我尝试安装或升级我的系统时说:' ImportError:没有名为pip的模块'。
我在2016年的某个地方遇到过这个问题并且从未找到答案,所以我再次在我的计算机上安装了Python。我希望有更好的方法来做到这一点,而不是再次安装整个Python和所有这些模块。
所以对我来说这有点奇怪,我希望有人知道这个问题并知道解决这个问题的方法。在我的下方,将在命令提示符下显示文本。
代码:
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'
答案 0 :(得分:0)
这与Windows上的磁盘驱动器有关。 Pip将新文件下载到当前驱动器(D:
),然后尝试将它们移动到系统文件(C:
上)并失败。
(见https://github.com/pypa/pip/issues/2824)
你能跑吗
python -m pip install -U pip
或pip
完全消失了吗?
如果它已经消失,那么你将不得不重新安装它。也许重新安装所有Python更容易,虽然可能更耗时。