在Windows 7 64位系统中安装pip

3
我已经在Python 2.7中安装了easy_install和setuptools。但是,我在使用easy_install pip安装pip时遇到了麻烦。我已经查阅了相关的StackOverflow帖子和博客文章,可仍未解决问题。
以下是我在Windows命令提示符中收到的错误信息:
Searching for pip
Reading http://pypi.python.org/simple/pip/
Download error: [Errno 10061] No connection could be made because the target mac
hine actively refused it -- Some packages may not be found!
Couldn't find index page for 'pip' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
Download error: [Errno 10061] No connection could be made because the target mac
hine actively refused it -- Some packages may not be found!
No local packages or download links found for pip
Best match: None
Traceback (most recent call last):
  File "C:\Python27\Scripts\easy_install-script.py", line 8, in <module>
    load_entry_point('setuptools==0.6c11', 'console_scripts', 'easy_install')()
  File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line
1712, in main
    with_ei_usage(lambda:
  File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line
1700, in with_ei_usage
    return f()
  File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line
1716, in <lambda>
    distclass=DistributionWithoutHelpCommands, **kw
  File "C:\Python27\lib\distutils\core.py", line 152, in setup
    dist.run_commands()
  File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line
211, in run
    self.easy_install(spec, not self.no_deps)
  File "C:\Python27\lib\site-packages\setuptools\command\easy_install.py", line
434, in easy_install
    self.local_index
  File "C:\Python27\lib\site-packages\setuptools\package_index.py", line 475, in
 fetch_distribution
    return dist.clone(location=self.download(dist.location, tmpdir))
AttributeError: 'NoneType' object has no attribute 'clone'

首先检查您是否能够执行此步骤 C:\Users\xyz>pip install。 您必须至少提供一个要安装的软件包名称(请参阅“pip help install”) - kvivek
3个回答

2

我正在使用Windows 7 x64进行工作,我完成了这个任务。

                        Installing Python 2.7

https://www.python.org/download/releases/2.7.2 --------Windows x86 MSI Installer (2.7.2) (sig)

安装完Python 2.7之后(我默认安装在c:\python27),你就准备好了。

                           **Installing PIP:**

下载文件get-pip.py

https://raw.github.com/pypa/pip/master/contrib/get-pip.py

将其保存在一个已知的文件夹中:c:\pip\

进入Windows - 运行 - 输入cmd.exe

在cmd.exe中输入:

cd c:\python27(或者你安装Python的路径)

你会看到这个:

c:\python27

现在输入(记得替换为你保存get-pip.py的路径,我们这里是c:\pip):

c:\python27\ python.exe c:\pip\get-pip.py

Pip将被安装。

                       Using Pip to Install Django 

现在已经安装了Python和Pip,请前往Windows - 运行 - 输入cmd.exe。
在cmd.exe中键入:
cd c:\python27
您将看到以下内容:
c:\python27
现在键入 python.exe -m pip install xxxxxxx
Pip会安装您所需的xxxxxx包。
例如: pip install Django==1.6.2
注意:此指南适用于完全不懂Python和Windows的新手。
问候, erick.alfaro@adtein.com www.adtein.com

1
我认为在尝试过程中,您可能已经搞乱了Python的设置。虽然我相信您可以仅使用python.org上的CPython安装程序(我和许多其他人都这样做)使其正常工作,但我强烈建议重新开始(干净地删除到目前为止的内容),并安装其中一个具有更多功能的Python发行版,例如: 它们附带安装了多个附加包,包括pip。它们的安装程序还会正确设置Windows PATH。因此,在运行安装程序后,您可以直接继续,启动cmd.exe并运行pythonpip install ...
免费版本的EPD可以在这里找到。我个人使用EPD和Python(x,y)都有不错的体验。这里是标准Python(x,y)安装程序带来的“插件”列表。请注意,对于Windows系统,EPD和Python(x,y)仅提供32位版本...然而,Windows 64位的ActivePython是免费的(PyPM包对于64位不免费)。根据您的需求,这可能不是一个问题。

1
我去了https://pypi.python.org/pypi/pip,那里有一个可以下载的tar文件。下载后,在Python\Scripts文件夹中的命令提示符中运行"easy_install pip-1.3.1.tar.gz"即可。看起来可以完成工作。希望这能帮到你。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接