Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
457 views
in Technique[技术] by (71.8m points)

python - Installing Twisted through pip broken on one server

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

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.

Case and version do not matter. Same result if I use "twisted", "Twisted", "Twisted==15.2.1".

This is an EC2 instance running Ubuntu 14.04.02.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Ok after struggling with this for several hours, I figured out the problem.

Running pip install --verbose twisted helped with the diagnosis.

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:

  1. sudo apt-get install libbz2-dev
  2. cd /<untarred python source dir>
  3. ./configure --prefix=<my install path> --enable-ipv6
  4. make
  5. make install

With this done, I can now create virtual environments and pip install Twisted.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...