Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named Crypto #1460

Closed
jamesob opened this issue Apr 29, 2016 · 3 comments
Closed

ImportError: No module named Crypto #1460

jamesob opened this issue Apr 29, 2016 · 3 comments

Comments

@jamesob
Copy link

jamesob commented Apr 29, 2016

Hi there,

I have a private project that depends on fabric. Specifically, we pin fabric==1.10.2.

Today, builds of this project have started mysteriously failing with the following stacktrace:

19:22:54.233     from fabric import api as fabric_api
19:22:54.233   File "/home/go/work/pipelines/make-ci-00/code/.venv/local/lib/python2.7/site-packages/fabric/api.py", line 11, in <module>
19:22:54.233     from fabric.decorators import (hosts, roles, runs_once, with_settings, task,
19:22:54.233   File "/home/go/work/pipelines/make-ci-00/code/.venv/local/lib/python2.7/site-packages/fabric/decorators.py", line 9, in <module>
19:22:54.233     from Crypto import Random
19:22:54.233 ImportError: No module named Crypto

Fabric has been pinned to the same version for weeks. Manually installing pycrypto alongside fabric resolves this issue.

Despite explicitly importing Crypto.Random, fabric's only dependency is paramiko, and pycrypto isn't referenced anywhere aside from paramiko docs.

IMO if you're importing pycrypto symbols explicitly within fabric, pycrypto should be cited as a dependency within setup.py.

Thanks!

@gtback
Copy link

gtback commented Apr 29, 2016

Paramiko 2.0 was recently released (and I think depends on cryptography rather than pycrypto). The 1.10.2 version of setup.py doesn't properly restrict the version of paramiko, but the 1.10.3 version does. Maybe upgrading to 1.10.3 will help.

Looks like this was changed in c7d3034

@jamesob
Copy link
Author

jamesob commented Apr 29, 2016

Can confirm that bumping to 1.11.1 has fixed this issue. Wonder why 1.10.2 decided to break today...

@bitprophet
Copy link
Member

@jamesob was this triggered by reinstalling Fabric in a new environment? As @gtback noted, paramiko changed recently and we put out earlier Fab releases that pin to paramiko<2 to avoid this kind of thing. You weren't on one of those which is likely why things broke.

That said, I didn't realize we were directly importing Crypto anywhere; just looked and yea, we had to do some dumb tweak to deal with a PyCrypto + parallelization quirk. That'll have to change if we ever undo the Paramiko version pin (which I would like to do sometime probably, once we're sure paramiko 2 is stable). So, thanks for surfacing this :)

Superbil added a commit to lowiki-org/localwiki-backend-server that referenced this issue Sep 10, 2016
Fix "No module named Crypto" from fabric/fabric#1460
c5c86a pushed a commit to c5c86a/vm that referenced this issue Feb 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants