Python 找不到满足 easy_install 要求的版本(来自版本:)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39083949/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 21:52:03  来源:igfitidea点击:

Could not find a version that satisfies the requirement easy_install (from versions: )

pythonpython-2.7pipeasy-installpycurl

提问by iamgr007

Python 2.7.12

pip 8.1.2

ubuntu-16.04

蟒蛇 2.7.12

点 8.1.2

ubuntu-16.04

I'm trying to install pycurlusing:

我正在尝试pycurl使用以下方法安装:

pip install pycurl

this is what I get,

这就是我得到的

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-8EU20I/pycurl/

命令“python setup.py egg_info”在 /tmp/pip-build-8EU20I/pycurl/ 中失败,错误代码为 1

So, I tried updating setup tools like this:

所以,我尝试更新这样的设置工具:

pip install --upgrade easy_install -U setuptools

i got

我有

Could not find a version that satisfies the requirement easy_install (from versions: ) No matching distribution found for easy_install

找不到满足easy_install要求的版本(来自版本:)没有找到easy_install的匹配发行版

I've no idea on what I'm missing. Please help me out!

我不知道我错过了什么。请帮帮我!

回答by iamgr007

sudo apt-get install python-pycurl

this solved the problem.

这解决了问题。

回答by harika kotta

Remove the virtual environment folder and recreate/reinstall it using virtualenv sampleenv .This may solve your problem

删除虚拟环境文件夹并使用 virtualenv sampleenv 重新创建/重新安装它。这可能会解决您的问题

回答by holdenweb

The issue here is that you are attempting to upgrade the setuptoolsthat came installed in your system Python, which requires changes to areas of the file system a "normal" user won't have (it requires root privileges).

这里的问题是您正在尝试升级setuptools系统 Python 中安装的程序,这需要更改“普通”用户不会拥有的文件系统区域(它需要 root 权限)。

Prefixing the command with sudomight help, but you should ask yourself whether you really want to change the system Python, since some OSs require Python "as installed" for various system purposes.

为命令添加前缀sudo可能会有所帮助,但您应该问问自己是否真的要更改系统 Python,因为某些操作系统需要 Python“按安装”用于各种系统目的。

It's a lot safer to install a second copy of Python somewhere you have write access to (I personally tend to use /usr/localbut YMMV) and then you won't need to worry about breaking your system. Further, as long as you set your PATH to include /usr/local/binyou can just use the pythoncommand to run it.

在你有写权限的地方安装 Python 的第二个副本要安全/usr/local得多(我个人倾向于使用但 YMMV),然后你就不必担心破坏你的系统了。此外,只要您将 PATH 设置为包含,/usr/local/bin您就可以使用该python命令来运行它。