简体   繁体   English

未安装 Python 2.7.11 pip

[英]Python 2.7.11 pip not installed

I have Python 2.7.11 installed on my machine which to my understanding should come with pip, however when I check the C:\\Python27\\Tools\\Scripts\\ directory there is no pip.exe present.我的机器上安装了 Python 2.7.11,据我所知,它应该带有 pip,但是当我检查C:\\Python27\\Tools\\Scripts\\目录时,没有pip.exe存在。

I have tried completely removing and reinstalling Python 2.7.11 without success.我曾尝试完全删除并重新安装 Python 2.7.11,但没有成功。 Running the installer pip is set to be installed, but after the install pip is nowhere to be found.运行安装程序pip设置为安装,但是安装后pip却无处可寻。

I also have Python 3.4 installed which has pip as expected.我还安装了 Python 3.4,它按预期具有 pip。 Any thoughts?有什么想法吗?

I encountered the same problem - pip not installed - with python-2.7.16, Win10, installing for 'all users'.我遇到了同样的问题 - pip 未安装 - 使用 python-2.7.16,Win10,为“所有用户”安装。 It was resolved when I allowed the MSI installer to target the default location (C:\\Python27) rather than changing it to under Program Files (x86).当我允许 MSI 安装程序以默认位置 (C:\\Python27) 为目标而不是将其更改为 Program Files (x86) 下时,问题得到解决。 I've no clue why this changed anything.我不知道为什么这会改变任何事情。

python2.7.11应该安装pip到c:\\python27\\scripts,你可以看这里

I used https://pip.pypa.io/en/stable/installing/ to make it install.我使用https://pip.pypa.io/en/stable/installing/来安装它。 Odd that an outside body has to make a tool to get pip to install.奇怪的是,外部机构必须制作一个工具来安装 pip。 There is no mention of pip.pypa.io on the Python web site. Python 网站上没有提到 pip.pypa.io。
Although I got error messages, it did install, so check carefully.虽然我收到错误消息,但它确实安装了,所以请仔细检查。
You also may see a message suggesting that you upgrade to pip 9.0 with the command 'pip install --upgrade.'您还可能会看到一条消息,建议您使用命令“pip install --upgrade”升级到 pip 9.0。 I highly recommend that.我强烈建议这样做。
Also, make sure you are in the directory where pip.exe is located when you run the commands.此外,请确保您在运行命令时位于 pip.exe 所在的目录中。 They don't tell you that, because they assume you know that, but we're not all geeks.他们不会告诉你这一点,因为他们假设你知道这一点,但我们并不都是极客。

For people who are running into this issue, I have a Windows 10 x86 dev box that I use for exploit development, Python 2.7 was installed due to Immunity Debugger, this install did not include the new SSL package and did not include "pip".对于遇到此问题的人,我有一个用于漏洞利用开发的 Windows 10 x86 开发箱,由于 Immunity Debugger 安装了 Python 2.7,此安装不包含新的 SSL 包,也不包含“pip”。

There was no "C:\\Python27\\Scripts" folder which included pip.没有包含 pip 的“C:\\Python27\\Scripts”文件夹。 I did have a "C:\\Python27\\Tools\\Scripts" folder which did not have pip installed.我确实有一个没有安装 pip 的“C:\\Python27\\Tools\\Scripts”文件夹。

I tired to install pip as suggested but did not work.我厌倦了按照建议安装 pip 但没有用。 Best way is to uninstall Python and install newest version, currently mine is 2.7.15 which came with pip as an option.最好的方法是卸载 Python 并安装最新版本,目前我的是 2.7.15,它带有 pip 作为选项。 This is what solved my issue, any older version of Python will need upgraded to support the SSL packages.这就是解决我的问题的原因,任何旧版本的 Python 都需要升级以支持 SSL 包。 You will receive the same errors when you try to install pip on an older version.当您尝试在旧版本上安装 pip 时,您将收到相同的错误。

If you have reinstalled Python which included the SSL package and it still does not have pip, trying installing pip this way:如果您重新安装了包含 SSL 包的 Python 并且它仍然没有 pip,请尝试以这种方式安装 pip:

1. curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

2. python get-pip.py

https://pip.pypa.io/en/stable/installing/ https://pip.pypa.io/en/stable/installing/

This should work if you have a newer version of Python.如果您有更新版本的 Python,这应该可以工作。

Once you have installed pip or newer version of python, go to "C:\\Python27\\Scripts" and you should see pip.exe.安装 pip 或更新版本的 python 后,转到“C:\\Python27\\Scripts”,您应该会看到 pip.exe。

I have installed " python-2.7.16 " in my windows 10 PC.我已经在我的 Windows 10 PC 中安装了“ python-2.7.16 ”。 PIP is installed under " C:\\Python27\\Scripts ". PIP安装在“ C:\\Python27\\Scripts ”下。 One can add the "C:\\Python27\\Scripts" path to environment variable and then access pip command from command prompt.可以将“C:\\Python27\\Scripts”路径添加到环境变量中,然后从命令提示符访问 pip 命令。

To add the path in environment variable:在环境变量中添加路径:

Control Panel\\System and Security\\System --> Advanced System Settings --> Advanced --> enviroment variables --> under system variable --> Path(variable name)控制面板\\系统和安全\\系统 --> 高级系统设置 --> 高级 --> 环境变量 --> 系统变量下 --> 路径(变量名)

Had the issue where no matter which version of python 2.7 I installed on windows 10 there was no pip.exe generated in the "Scripts" folder.有一个问题,无论我在 Windows 10 上安装哪个版本的 python 2.7,“脚本”文件夹中都没有生成 pip.exe。

I solved it by ensuring that that MSI Installer file had Admin privileges before installing我通过确保 MSI 安装程序文件在安装前具有管理员权限来解决它

如果未安装 pip,您可以使用 easy_install.exe 安装 pip 和其他模块,您可以在其中找到 easy install

python -m easy_install pip

I had the same issue:我有同样的问题:

  • Installed Python 27已安装 Python 27
  • Tried to use pip, but failed with unrecognized command error尝试使用 pip,但因无法识别的命令错误而失败
  • Checked installation: no "C:\\Python27\\Scripts", only "C:\\Python27\\Tools\\Scripts"检查安装:没有“C:\\Python27\\Scripts”,只有“C:\\Python27\\Tools\\Scripts”

This issue happens only on some versions of Windows.此问题仅在某些版本的 Windows 上发生。

HOW TO FIX IT:如何修复:

  • Uninstall Python 27卸载 Python 27
  • Reinstall Python 27, but unselect "pip" feature重新安装 Python 27,但取消选择“pip”功能
  • Check installation: no "C:\\Python27\\Scripts" as expected检查安装:没有预期的“C:\\Python27\\Scripts”
  • Start the installer again and use "Change Python"再次启动安装程序并使用“更改 Python”
  • Set "pip" and "Add Python.exe to Path" features to be installed设置要安装的“pip”和“Add Python.exe to Path”功能
  • Check installation: "C:\\Python27\\Scripts" is now correctly present检查安装:“C:\\Python27\\Scripts”现在正确存在

So for some unknown reason, pip is not correctly installed on some versions of Windows if it is installed during default Python 27 setup.因此,由于某些未知原因,如果在默认 Python 27 设置期间安装了 pip,则某些版本的 Windows 上没有正确安装它。 To fix this issue, pip must be installed afterwards using the "Change Python" setup.要解决此问题,必须在之后使用“更改 Python”设置安装 pip。

It happens on windows as you should have admin rights to install anything on disk C. I have the same issue Scripts folder was not installed.它发生在 Windows 上,因为您应该具有在磁盘 C 上安装任何内容的管理员权限。我有同样的问题 Scripts 文件夹未安装。 I would sugest to instal it on disk D.我建议将它安装在磁盘 D 上。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM