Python pip install 给我这个错误“无法打开文件‘pip’:[Errno 2]没有这样的文件或目录”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/42602059/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 21:56:44  来源:igfitidea点击:

pip install gives me this error "can't open file 'pip': [Errno 2] No such file or directory"

pythonpython-2.7python-3.xremote-access

提问by Bipin Shetty

I have tried using pip -m install win32api, but I still get the error "can't open file 'pip': [Errno 2] No such file or directory"

我试过使用pip -m install win32api,但我仍然收到错误“无法打开文件'pip':[Errno 2]没有这样的文件或目录”

Can anyone help me on this?

谁可以帮我这个事?

Note: I have renamed the python.exe file as python2 and python3, since I have both versions installed on my pc.

注意:我已将 python.exe 文件重命名为 python2 和 python3,因为我的电脑上安装了这两个版本。

回答by Paandittya

python -m pip install pypiwin32

This should solve the issue. Note that the package name you used is not the canonical name.

这应该可以解决问题。请注意,您使用的包名称不是规范名称。

回答by PatXio

Depending on your python interpreter environment variable path, you need to either py -m pip install win32api

根据您的python解释器环境变量路径,您需要 py -m pip install win32api

or

或者

Use python -m pip install win32api

python -m pip install win32api

In my case, py -m pip install win32apiworked but python -m pip install win32apididn't

就我而言,py -m pip install win32api工作但python -m pip install win32api没有

回答by Nicola Spanu

I had the same error message while trying to lunch the command "manage.py". I solved the problem by writing the command in python shell after entering the folder where the files django-admin.exe and django-admin.py are. Please see screen-shot attached.

我在尝试使用命令“manage.py”时遇到相同的错误消息。我在进入文件 django-admin.exe 和 django-admin.py 所在的文件夹后,通过在 python shell 中编写命令解决了问题。请参阅附带的屏幕截图。

enter image description here

在此处输入图片说明