Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

PyCrypto 2.4 woes #459

Closed
bitprophet opened this Issue Oct 24, 2011 · 3 comments

Comments

Projects
None yet
2 participants
Owner

bitprophet commented Oct 24, 2011

Just wanted to document this here instead of in a commit comment...PyCrypto 2.4 does not install cleanly on any system I've tried, which is why all latest Fabric/ssh versions require Crypto <2.4.


» easy_install pycrypto                                                                                                                                        1
Searching for pycrypto
Reading http://pypi.python.org/simple/pycrypto/
Reading http://www.pycrypto.org/
Reading http://pycrypto.sourceforge.net
Reading http://www.amk.ca/python/code/crypto
Best match: pycrypto 2.4
Downloading https://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-2.4.tar.gz
Processing pycrypto-2.4.tar.gz
Running pycrypto-2.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-LIXxta/pycrypto-2.4/egg-dist-tmp-WlEtWO
warning: PCTBuildPy: byte-compiling is disabled, skipping.
error: Setup script exited with error: src/config.h: No such file or directory

Same thing happens if one obtains the source code for e.g. fabric or ssh or paramiko, and runs their setup.py develop or setup.py install.

However, pip install pycrypto seems to work in any situation, even one where it's not using distribute behind the scenes (as I have in some virtualenvs.) So it's not clear exactly what the problem is.

I can replicate this error in clean virtualenvs under:

  • Python 2.5, 2.6 and 2.7 on Mac OS X 10.7
  • Python 2.6 on Ubuntu 10.04
  • Python 2.7 on Ubuntu 11.04

and in a global, non-virtualenv (but otherwise mostly clean) environment under:

  • Python 2.7 on Ubuntu 11.04
  • Python 2.5, 2.6 and 2.7 on Mac OS X 10.7 (using the default easy_install-2.x scripts)

So, it's also not just a virtualenv related issue.

I have encountered the problem when logged in as as user which is not myself, so it seems unlikely to be something in my specific environment setup.

I'll submit this to Crypto upstream sometime soon, but for now my software does not need any of the new features in 2.4 and it's not worth the effort to figure out if we can somehow fix it on our end (which seems unlikely.)

@ghost ghost assigned bitprophet Oct 24, 2011

Owner

bitprophet commented Oct 24, 2011

Interestingly, when I ran easy_install --version, globally (no venv) on my 11.04 box, it is...the distribute version!

I am creating a completely vanilla 11.04 VM to see if this was something we added, or if Ubuntu is now using Distribute full-time. EDIT: Yea, apt-get install python-setuptools now uses Distribute by default.

On my OS X 10.7 box, easy_install appears to be the Apple-installed default python 2.7 setuptools, not Distribute. It also results in the same config.h error during easy_install pycrypto.

I think I've done enough research here to assert that it does not install well on two major platforms, virtualenv or no virtualenv, and only via easy_install/setup.py. I've gotten reports from a few folks that did not have problems building Crypto from its setup.py (one of which was on Windows) so it's still unclear exactly where the problem lies, but it's definitely not something niche.

jtriley commented Oct 26, 2011

Same issues here on Mac 10.6.8 and Gentoo Linux with distribute in a virtualenv. I'm able to install 2.4 successfully by hand using "python setup.py install" just not with easy_install. Using pycrypto==2.3 in my package's setup.py for now.

Owner

bitprophet commented Nov 4, 2011

Crypto just pushed 2.4.1 which fixes this problem; I have updated all Fabric related setup.py files (Fab 1.1, 1.2 and ssh for 1.3/master) to change <2.4 to <!= 2.4, which appears to yank down 2.4.1 correctly in a few tests. And 2.4.1 installs fine via setup.py / setuptools.

Will push a release this weekend probably.

bitprophet added a commit that referenced this issue Nov 4, 2011

@bitprophet bitprophet closed this Nov 4, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment