python容易安装的问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20219628/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Problems with python easy install
提问by jonas
I have a problem using easy_install for matplotlib-venn. I'm on a windows computer using python2.7. I'm suspecting the path is not correct but I do not know how to fix the problem. Could anyone help me? I'm attaching the output from trying to run the easy_install command in the CMD prompter.
我在将 easy_install 用于 matplotlib-venn 时遇到问题。我在使用 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
Output from trying the pip install suggestion:
尝试 pip install 建议的输出:
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
采纳答案by alko
Based on
基于
Download error on https://pypi.python.org/simple/matplotlib-venn/: [Errno 11004] getaddrinfo failed
and
和
Cannot fetch index base URL https://pypi.python.org/simple/
it seems that your have network issue. Do you run your machine behind a firewall or a proxy?
看来你有网络问题。您是否在防火墙或代理后面运行您的机器?
For easy_installto work behind proxy, you have to setup needed environments, for example
为了easy_install在代理后面工作,您必须设置所需的环境,例如
set http_proxy="user:password@server:port"
set https_proxy="user:password@server:port"
For pip you can use -proxyargument. More details on pip usage behind proxy see in this thread: How to use pip on windows behind an authenticating proxy
对于 pip,您可以使用-proxy参数。有关代理背后 pip 使用的更多详细信息,请参阅此线程:如何在身份验证代理后面的 Windows 上使用 pip
回答by itdxer
I think this is your solution
我认为这是你的解决方案
easy_install pip
pip install matplotlib-venn
No module matplotlib-vennin easy_install
matplotlib-venneasy_install 中没有模块
And for future, use pip for install any package for python.
对于未来,使用 pip 为 python 安装任何包。
回答by Shameema
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
For me the same error occurred for rtree package and I did the cache search and installed the liraries
对我来说,rtree 包发生了同样的错误,我进行了缓存搜索并安装了 liraries
回答by Abhilash Ranjan
In-case of cloudera box if you are trying then this will work as reaised in bugzile. https://bugzilla.redhat.com/show_bug.cgi?id=1510444It works for my cloudera vm jut follow the insteruction and then try to isntall by easy_install.
如果您正在尝试使用 cloudera 框,那么这将在 bugzile 中发挥作用。 https://bugzilla.redhat.com/show_bug.cgi?id=1510444它适用于我的 cloudera vm 只需按照说明操作,然后尝试通过 easy_install 安装。
# easy_install -i https://pypi.python.org/simplestitches Searching for stitches Reading https://pypi.python.org/simple/stitches/Best match: stitches 0.11 Downloading https://pypi.python.org/packages/9d/73/681005f0f0fb9483f0d94547a35059c776144fc998780b9ef00167a50f3d/stitches-0.11.tar.gz#md5=0ac0b6e418767e6ec5cf684460d1972fProcessing stitches-0.11.tar.gz Running stitches-0.11/setup.py -q bdist_egg --dist-dir /tmp/easy_install-ZMIU8w/stitches-0.11/egg-dist-tmp-82ctsZ zip_safe flag not set; analyzing archive contents... stitches.connection: module references fileAdding stitches 0.11 to easy-install.pth file
# easy_install -i https://pypi.python.org/simpleStitches 搜索针迹 阅读https://pypi.python.org/simple/stitches/最佳匹配:stitches 0.11 下载https://pypi.python.org/包/ 9D / 73 / 681005f0f0fb9483f0d94547a35059c776144fc998780b9ef00167a50f3d /拆线-0.11.tar.gz#MD5 = 0ac0b6e418767e6ec5cf684460d1972f处理针-0.11.tar.gz运行针迹- 0.11 / setup.py -q bdist_egg --dist-DIR / TMP / easy_install的-ZMIU8w /针迹-0.11/egg-dist-tmp-82ctsZ zip_safe 标志未设置;分析存档内容...stitches.connection:模块引用文件将针迹0.11 添加到easy-install.pth 文件
Installed /usr/lib/python2.6/site-packages/stitches-0.11-py2.6.egg Processing dependencies for stitches ... ... Searching for pynacl>=1.0.1 Reading https://pypi.python.org/simple/pynacl/Best match: PyNaCl 1.2.0 Downloading https://pypi.python.org/packages/fa/38/0f35ec4beb6562f1abfa07914db1cea978e93da409ba6293f810d9e677d6/PyNaCl-1.2.0.tar.gz#md5=7a31e95f5f457184b1660b71d6808b19Processing PyNaCl-1.2.0.tar.gz Running PyNaCl-1.2.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-a0vNJS/PyNaCl-1.2.0/egg-dist-tmp-QYvAk9 Checking .pth file support in . /usr/bin/python -E -c pass Searching for cffi>=1.4.1 Reading http://pypi.python.org/simple/cffi/Couldn't find index page for 'cffi' (maybe misspelled?) Scanning index of all packages (this may take a while) Reading http://pypi.python.org/simple/No local packages or download links found for cffi>=1.4.1 error: Could not find suitable distribution for Requirement.parse('cffi>=1.4.1')
安装/usr/lib/python2.6/site-packages/stitches-0.11-py2.6.egg 处理缝合依赖…… 搜索pynacl>=1.0.1 阅读https://pypi.python。组织/简单/ 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 搜索 cffi>=1.4.1 阅读http://pypi.python.org/simple/cffi/找不到“cffi”的索引页(可能拼写错误?)扫描所有包的索引(这可能需要一段时间)阅读http://pypi.python.org/simple/没有找到 cffi 的本地包或下载链接> =1.4.1 错误:找不到适合 Requirement.parse('cffi>=1.4.1') 的分布
So the only solution is hacking the source code:
所以唯一的解决方案是破解源代码:
sed -i s,http://pypi.python.org,https://pypi.python.org, /usr/lib/python2.6/site-packages/setuptools/command/easy_install.py
sed -is, http://pypi.python.org,https://pypi.python.org, /usr/lib/python2.6/site-packages/setuptools/command/easy_install.py
sudo
须藤

