python: 无法打开文件 get-pip.py 错误 2] 没有这样的文件或目录

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39790923/
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 22:43:00  来源:igfitidea点击:

python: can't open file get-pip.py error 2] no such file or directory

pythonpipinstaller

提问by Muhammad Faizan Khan

When I am trying to execute this in CMD

当我尝试在 CMD 中执行此操作时

python get-pip.py

I am getting this error:

我收到此错误:

python: can't open file get-pip.py error 2] no such file or directory
python: can't open file get-pip.py error 2] no such file or directory

While the file store in (get-pip.py)

虽然文件存储在 (get-pip.py) 中

C:\Python27\Tools\Scripts

C:\Python27\工具\脚本

采纳答案by vovaminiof

Try to either cdinto folder with script (cd "C:\Python27\Tools\Scripts") or add this folder to your PATH variable.

尝试cd使用脚本 ( cd "C:\Python27\Tools\Scripts")进入文件夹或将此文件夹添加到您的 PATH 变量。

回答by Denis Rybalka

For Linux/Mac, you can go for

对于 Linux/Mac,你可以去

curl 'https://bootstrap.pypa.io/get-pip.py' > get-pip.py && sudo python get-pip.py
  1. Fetching installer
  2. Executing file with superuser access
  1. 正在获取安装程序
  2. 以超级用户权限执行文件

回答by Hyman_1729

Go to this link - https://www.liquidweb.com/kb/how-to-install-pip-on-ubuntu-14-04-lts/

转到此链接 - https://www.liquidweb.com/kb/how-to-install-pip-on-ubuntu-14-04-lts/

For me it installed in

对我来说它安装在

vagrant@vagrant-ubuntu-trusty-64:/vagrant$ which pip /usr/local/bin/pip

vagrant@vagrant-ubuntu-trusty-64:/vagrant$ which pip /usr/local/bin/pip

So there is a mistake in the post as the command pip --help

所以帖子中有一个错误作为命令 pip --help

will not work.

不管用。

vagrant@vagrant-ubuntu-trusty-64:/vagrant$ pip --help -bash: /usr/bin/pip: No such file or directory

vagrant@vagrant-ubuntu-trusty-64:/vagrant$ pip --help -bash: /usr/bin/pip: No such file or directory

But you still have pip installed.

但是你仍然安装了pip。

Enjoy!

享受!