Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Everything works fine until this:

    $ cd pycrypto-2.6
    $ python setup.py install

This is the output:

running install
running build
running build_py
running build_ext
running build_configure
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
running install_lib
creating /usr/local/lib/python2.7/dist-packages/Crypto
error: could not create '/usr/local/lib/python2.7/dist-packages/Crypto': Permission denied

What is the best solution to install Pycrypto on Ubuntu 12? i need it for Twisted python modules. Thank you!

share|improve this question
Did you try to executing any command with preceding sudo? For example: sudo python setup.py install. Give it a try hope that was your problem. –  Saurav Kumar Sep 2 '13 at 16:28
it worked , thank you! –  Ciobanu Alexandru Sep 2 '13 at 16:29
problem is , when i test it i got this: >>> import Crypto >>> import twisted.conch.ssh.transport Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named conch.ssh.transport >>> –  Ciobanu Alexandru Sep 2 '13 at 16:32
i solve it. thank you! –  Ciobanu Alexandru Sep 2 '13 at 16:48
now, the problem moved to another module: >>> twisted.conch.ssh.transport.RSA Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute 'RSA' >>> –  Ciobanu Alexandru Sep 2 '13 at 16:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.