Solving PyCrypto 2.6.1 errors for Python 3.4 (Windows7 x64)?

1

1

Whilst there's less of an issue with Python 2.7, Python 3.4 relies on the pycrypto library for numerous wrappers/APIs/tools such as BlockTrail, pycoin, pybitcointools, etc etc.

The error I'm getting:

building 'Crypto.Random.OSRNG.winrandom' extension

warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.

error: Unable to find vcvarsall.bat

It's an issue with the gcc C++ compiler for Windows, I understand, however the binaries offered in that solution, sadly, don't cover Python 3.4 (version for 3.3 won't cut it, unfortunately).

A solution - other than installing pseudo-Posix (ie Ming32) - would be very useful for those transitioning to Python 3.xenter preformatted text here

Wizard Of Ozzie

Posted 2015-02-12T06:12:51.343

Reputation: 4 535

Answers

1

This worked for me. Download the package from here. I personally tested this for Python 3.4 and Windows 64 bit. https://www.dropbox.com/s/n6rckn0k6u4nqke/pycrypto-2.6.1.zip?dl=0

  • Select your architecture and install the exe file.

  • This will create a Lib folder in your python directory. My python was installed in C:\python3.4. This software created a directory in C:\ .The directory was named "Lib".

  • Inside lib there is "site-packages". Copy everything under site-packages (only two folders - Crypto and *.egg-info) and then paste where your python's site-package is. E.g. I am using virtualenv and my path was C:\Users\RChaudhary\Programs\PythonVirtualEnvironment\bookeeping.frontend\Lib\site-packages

  • I pasted my files here and voila, it works. pip3.4 list showed my the package and my program also runs correctly.
  • From your program manager, uninstall what you installed earlier. Your pycrypto will still work.

Rash

Posted 2015-02-12T06:12:51.343

Reputation: 126

From your program manager, uninstall... that's good to know!Wizard Of Ozzie 2015-05-19T05:06:45.763

Lol! Sorry about that. I have a habit of cleaning. So I cannot stand having unwanted files on my system.Rash 2015-05-19T14:07:10.967

I was being serious FWIWWizard Of Ozzie 2015-05-19T23:06:50.787

2

Binaries available for Python 3.4:

As outlined here on SE, binaries available for Python 2.x - 3.3:

This solves the dependencies issues error compile failed with error code 1 using pip. Also, the following error screen (at the CLI) should not be appearing any more following installation, via pip or setup install, of pycrypto dependent libraries!

Skipping implicit fixer: ws_comma
running build_ext
building 'Crypto.Random.OSRNG.winrandom' extension
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
error: Unable to find vcvarsall.bat

Wizard Of Ozzie

Posted 2015-02-12T06:12:51.343

Reputation: 4 535