【问题标题】:Problems with python easy installpython容易安装的问题
【发布时间】:2013-12-11 17:55:11
【问题描述】:

我在为 matplotlib-venn 使用 easy_install 时遇到问题。我在使用 python2.7 的 Windows 计算机上。 我怀疑路径不正确,但我不知道如何解决问题。 有人可以帮我吗? 我正在附加尝试在 CMD 提示器中运行 easy_install 命令的输出。

C:\Python27\Scripts>easy_install matplotlib-venn
Searching for matplotlib-venn
Reading https://pypi.python.org/simple/matplotlib-venn/
Download error on https://pypi.python.org/simple/matplotlib-venn/: [Errno 11004]
 getaddrinfo failed -- Some packages may not be found!
Couldn't find index page for 'matplotlib-venn' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: [Errno 11004] getaddrinfo fai
led -- Some packages may not be found!
No local packages or download links found for matplotlib-venn
error: Could not find suitable distribution for Requirement.parse('matplotlib-ve
nn')
install for matplotlib-venn package

尝试 pip 安装建议的输出:

C:\Python27\Scripts>easy_install pip
Searching for pip
Best match: pip 1.4.1
Adding pip 1.4.1 to easy-install.pth file
Installing pip-script.py script to C:\Python27\Scripts
Installing pip.exe script to C:\Python27\Scripts
Installing pip.exe.manifest script to C:\Python27\Scripts
Installing pip-2.7-script.py script to C:\Python27\Scripts
Installing pip-2.7.exe script to C:\Python27\Scripts
Installing pip-2.7.exe.manifest script to C:\Python27\Scripts
Using c:\python27\lib\site-packages
Processing dependencies for pip
Finished processing dependencies for pip
C:\Python27\Scripts>pip install matplotlib-venn
Downloading/unpacking matplotlib-venn
  Cannot fetch index base URL https://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement matplotlib-venn
Cleaning up...
No distributions at all found for matplotlib-venn
Storing complete log in C:\Users\jherman8\pip\pip.log

【问题讨论】:

  • 这很奇怪。如果您转到提供日志输出的链接地址,您可以在那里找到matplotlib-venn。您确定输入名称中没有编码问题吗? pypi.python.org/simple/matplotlib-venn

标签: python python-2.7 matplotlib easy-install matplotlib-venn


【解决方案1】:

基于

Download error on https://pypi.python.org/simple/matplotlib-venn/: [Errno 11004] getaddrinfo failed 

Cannot fetch index base URL https://pypi.python.org/simple/ 

您的网络似乎有问题。您在防火墙或代理后运行您的计算机吗?

要让easy_install 在代理后面工作,您必须设置所需的环境,例如

set http_proxy="user:password@server:port"
set https_proxy="user:password@server:port"

对于 pip,您可以使用 -proxy 参数。有关代理背后 pip 使用的更多详细信息,请参见此线程:How to use pip on windows behind an authenticating proxy

【讨论】:

  • 谢谢,我会试试这个。但是我以前从未执行过这种类型的设置,所以我现在不知道该怎么做。对于像我这样的新手,你有什么分步说明吗?
  • @jonas 对于 pip,请参阅我的答案中的链接。描述了如何在 win 中设置环境变量here
  • 好的,我应该输入哪个路径?
  • @jonas 不是路径,您应该为 easy_install 设置 http_proxy 变量。值取决于您的代理配置
  • 抱歉,我使用的是您发送给我的分步说明链接。我会再试一次
【解决方案2】:

我认为这是您的解决方案

easy_install pip
pip install matplotlib-venn

easy_install 中没有模块 matplotlib-venn

对于未来,使用 pip 安装任何 python 包。

【讨论】:

  • 试过了,pip 安装很顺利,但是 matplolib-venn 不行,上面的 se 输出
  • 嗯,你的意思是找到了,但是安装不了?你以root身份运行你的终端?在 linux 中,我从 sudo 安装它。
  • 刚刚安装了matplotlib-venneasy_install
【解决方案3】:
student@student-WIV68105-0080:~$ **sudo apt-cache search rtree**
libcneartree-dev - Library and headers for solving the Nearest Neighbor Problem
libcneartree5 - Library for solving the Nearest Neighbor Problem
student@student-WIV68105-0080:~$ **sudo apt-get install libcneartree-dev libcneartree5**
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libcvector2
The following NEW packages will be installed:
  libcneartree-dev libcneartree5 libcvector2

对我来说,rtree 包也发生了同样的错误,我进行了缓存搜索并安装了库

【讨论】:

    【解决方案4】:

    如果您正在尝试使用 cloudera 框,那么这将按照 bugzile 中的方式工作。 https://bugzilla.redhat.com/show_bug.cgi?id=1510444 它适用于我的 cloudera vm,只需按照说明操作,然后尝试通过 easy_install 安装。

    # easy_install -i https://pypi.python.org/simplestitches 搜索缝线 阅读 https://pypi.python.org/simple/stitches/ 最佳匹配:stitches 0.11 下载 https://pypi.python.org/packages/9d/73/681005f0f0fb9483f0d94547a35059c776144fc998780b9ef00167a50f3d/stitches-0.11.tar.gz#md5=0ac0b6e418767e6ec5cf684460d1972f 处理stitches-0.11.tar.gz 运行stitches-0.11/setup.py -q bdist_egg --dist- dir /tmp/easy_install-ZMIU8w/stitches-0.11/egg-dist-tmp-82ctsZ zip_safe 标志未设置;分析存档内容...stitches.connection:模块引用文件将stitches 0.11添加到easy-install.pth文件

    已安装/usr/lib/python2.6/site-packages/stitches-0.11-py2.6.egg 处理stitches的依赖... ...搜索pynacl>=1.0.1阅读https://pypi.python.org/simple/pynacl/最佳匹配: PyNaCl 1.2.0 正在下载https://pypi.python.org/packages/fa/38/0f35ec4beb6562f1abfa07914db1cea978e93da409ba6293f810d9e677d6/PyNaCl-1.2.0.tar.gz#md5=7a31e95f5f457184b1660b71d6808b19 处理 PyNaCl-1.2.0.tar.gz 运行 PyNaCl-1.2.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-a0vNJS/PyNaCl-1.2.0/ egg-dist-tmp-QYvAk9 检查 .pth 文件支持。 /usr/bin/python -E -c pass Searching for cffi>=1.4.1 Reading http://pypi.python.org/simple/cffi/ 找不到'cffi'的索引页面(可能拼写错误?)扫描所有包的索引(这可能需要一段时间)阅读http://pypi.python.org/simple/没有找到cffi>=1.4.1错误的本地包或下载链接:找不到Requirement.parse('cffi>=1.4.1')的合适分布

    所以唯一的解决方案是破解源代码:

    sed -is,http://pypi.python.org,https://pypi.python.org, /usr/lib/python2.6/site-packages/setuptools/command/easy_install.py

    须藤

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-04-09
      • 2021-08-03
      • 1970-01-01
      • 1970-01-01
      • 2022-09-25
      • 2019-04-15
      相关资源
      最近更新 更多