问题描述
我正在新服务器上设置一个virtualenv,当我在需求文件中使用pip时,它在Twisted上一直不行.我将Twisted线路注释掉,其他所有东西都安装好了.在命令行上,这是我尝试安装Twisted时看到的输出(一旦到达Twisted行,我便会在运行整个需求文件时看到相同的错误):
I am setting up a virtualenv on a new server, and when I used pip on our requirements file, it kept dying on Twisted. I commented the Twisted line out, and everything else installed fine. At the command line, this is the output I see when I try to install Twisted (the same error I see when I run the entire requirements file once it gets to the Twisted line):
(foo)company@server:~$ pip install twisted
Collecting twisted
Could not find a version that satisfies the requirement twisted (from versions: )
No matching distribution found for twisted
我可以从我的开发机和其他服务器上安装Twisted fine,在该服务器上,我似乎可以安装其他软件包.
I can install Twisted fine from my dev machine and other servers, and on this server I seem to be able to install other packages fine.
大小写和版本无关紧要.如果使用扭曲",扭曲",扭曲== 15.2.1",结果相同.
Case and version do not matter. Same result if I use "twisted", "Twisted", "Twisted==15.2.1".
这是运行Ubuntu 14.04.02的EC2实例.
This is an EC2 instance running Ubuntu 14.04.02.
推荐答案
好了几个小时后,我发现了问题所在.
Ok after struggling with this for several hours, I figured out the problem.
运行pip install --verbose twisted
有助于诊断.
该错误消息具有误导性.问题是我没有事先安装libbz2-dev就构建了Python 2.7.10的自定义安装.因此,解决此问题的步骤是:
The error message is misleading. The problem is that I built a custom installation of Python 2.7.10 without having previously installed libbz2-dev. So the steps to fix this were:
-
sudo apt-get install libbz2-dev
-
cd /<untarred python source dir>
-
./configure --prefix=<my install path> --enable-ipv6
-
make
-
make install
sudo apt-get install libbz2-dev
cd /<untarred python source dir>
./configure --prefix=<my install path> --enable-ipv6
make
make install
完成此操作后,我现在可以创建虚拟环境并pip安装Twisted.
With this done, I can now create virtual environments and pip install Twisted.
这篇关于在一台服务器上安装Twisted through pip破坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!