【问题标题】:Setting up pip in Windows 7 64-bit在 Windows 7 64 位中设置 pip
【发布时间】:2013-02-12 23:33:40
【问题描述】:

我在Python 2.7 中安装了easy_installsetuptools。我在使用easy_install pip 安装pip 时做噩梦。我已经关注了我的 SO 帖子和博客,但仍然没有帮助。

以下是我在 Windows cmd 中收到的错误:

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&gt;pip install You must give at least one requirement to install (see "pip help install")

标签: python python-2.7 pip setuptools easy-install


【解决方案1】:

我认为在您的尝试过程中,您不知何故弄乱了您的 Python 设置。虽然我确信您可以只使用 python.org 的 CPython 安装程序(我和其他许多人都这样做),但我强烈建议您重新开始(彻底删除您目前拥有的)并安装其中一个 Python 发行版具有更多功能,例如:

它们安装了几个额外的软件包,包括 pip。他们的安装程序还会正确设置您的 Windows PATH。因此,运行安装程序后,您可以继续,启动 cmd.exe 并运行 pythonpip install ...

EPD 的免费版本可以在here 找到。我自己在 EPD 和 Python(x,y) 方面都有很好的经验。 Here 是标准 Python(x,y) 安装程序带来的“插件”列表。请注意,对于 Windows,EPD 和 Python(x,y) 都只能作为 32 位版本提供……但是,用于 Windows 64 位的 ActivePython 是免费的(PyPM 包对于 64 位不是免费的)。根据您的需要,这可能不是问题。

【讨论】:

    【解决方案2】:

    我去了https://pypi.python.org/pypi/pip 您可以从那里下载一个 tar。 下载后,只需从 Python\Scripts 文件夹中的命令提示符运行“easy_install pip-1.3.1.tar.gz”。 似乎完成了这项工作。 希望这会有所帮助

    【讨论】:

      【解决方案3】:

      我这样做了,我正在使用 Windows 7 x64。

                              Installing Python 2.7
      

      https://www.python.org/download/releases/2.7.2 --------Windows x86 MSI 安装程序 (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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-03-14
        • 2016-07-14
        • 2017-04-05
        • 1970-01-01
        • 2014-03-13
        • 1970-01-01
        相关资源
        最近更新 更多