Python - 找不到 get-pip.py

标签 python python-2.7 powershell

我已经从 pip 网站保存了 pip 源文件,但是当我点击打开它时(从 chrome 上的浏览​​器)它说它无法在桌面上找到它(我保存它的地方)。它显然就在桌面上。

然后我尝试在终端中启动 pip。

这是我在终端输入的内容,然后是我收到的结果:

PS C:\Users\Kyle> pip
Program 'get-pip.py' failed to execute: Application not found
At line:1 char:4
+ pip <<<< .
At line:1 char:1
+  <<<< pip
    + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException
    + FullyQualifiedErrorId : NativeCommandFailed

有趣的是,我只输入了 pip,却提示:'get-pip.py' 执行失败。 我还尝试更改“get-pip.py”文件位置并尝试更改 PATH 变量。 我在 Windows 7 上运行 python 2.7.3。

有谁知道我哪里做错了吗?

最佳答案

这是与使用 get-<something> convetion to name the PowerShell cmdlets that retrieve a resource 的 Windows PowerShell 的有趣巧合。 .有一种通过省略 get- 来调用 get 命令行开关的简写方法。部分。这就是它尝试通过键入 pip 来使用 PowerShell 运行文件的原因。当然它失败了。

您应该使用以下方式运行 pip install:

python get-pip.py

参见 docs .

关于Python - 找不到 get-pip.py,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24836737/

相关文章:

python - R Markdown : How can I make RStudio display Python plots inline instead of in new window?

python - 没有名为 admin.sites.urls 的模块

Python 'Integer devide by Zero' 错误 Pyglet 和 AVBin

rest - 使用PassThru时Invoke-RestMethod OutFile为空

regex - 为什么用。*正则表达式有两个匹配项?

python - 何时在 Django 的 View 或模型中写出

python - 相对于多图中图形的 Matplotlib 图例

python - 为什么这段python代码会在执行过程中挂掉呢?

sql-server - Visual Studio团队在线服务-运行sql脚本

python - 确定句子中缺失词所属的位置