PIP安装:无法打开文件PIP,或父模块“未加载" [英] Pip install: can't open file pip, or Parent module '' not loaded
问题描述
首先感谢您阅读.
我正在尝试安装Django.所以这是我在命令行中所做的:
I'm trying to install Django. So here's what I do in the command line:
C:\>python34 pip install Django
这就是我得到的:
C:\Python34\python.exe: can't open file 'pip': [Errno 2] No such file or directory
如果我在site-packages目录中也这样做:
If I do the same from the site-packages directory:
C:\Python34\Lib\site-packages>python34 pip install Django
Traceback (most recent call last):
File "C:\Python34\lib\runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "C:\Python34\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "pip\__main__.py", line 2, in <module>
from .runner import run
SystemError: Parent module '' not loaded, cannot perform relative import
我以前使用过pip,但效果很好,但是现在我不知道如何正确运行它...我试图首先找到一个答案,但是我听不懂它们中的任何一个.可能是因为我对这一切还比较陌生.谁能用一年级水平的语言来解释我需要做些什么才能做到这一点?
I used pip before, and it worked fine, but now I don't know how to run it properly... I tried to find an answer first, but I don't understand any of them. Probably because I'm relatively new to all this. Could anyone explain in first-grade-level-language what I need to do to get this right?
推荐答案
假设您已安装pip,并且希望通过python而不是独立的pip客户端来完成此操作,则也可以
Assuming you have pip installed and you want to do this through python as opposed to the standalone pip client, you can also do
python -m pip install SomePackage
这篇关于PIP安装:无法打开文件PIP,或父模块“未加载"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!