Windows binaries for M2Crypto SSL Python library, courtesy of the grr project.
They're reproduced here, to improve availability.
These archives need to be installed by hand. They are not installable using the standard Python Setuptools support. I have taken the liberty of doing this, and making the installable packages available via PyPI by the names given:
Building M2Crypto From Source
In the event that you want or need to build M2Crypto from source, the directions below were those that appeared at the grr page above at the time of this writing, for your reference. They have been updated for Markdown.
Instructions from the grr Project
Download and install ActiveState Perl from: ActiveState Perl
Download and install NASM from: NASM
Download and install swig from: swig
Extract in C:\grr-build
Grab a copy of the latest version of OpenSSL from: OpenSSL and extract it in the build directory.
For more info see: openssl-1.0.1e\INSTALL.W32 or openssl-1.0.1e\INSTALL.W64
To create a 32-bit build run the following commands from the Visual Studio command prompt:
set PATH=%PATH%;C:\Program Files\nasm cd C:\grr-build\openssl-1.0.1e perl Configure VC-WIN32 --prefix=C:\grr-build\openssl ms\do_nsam.bat nmake -f ms\ntdll.mak nmake -f ms\ntdll.mak install
To create a 64-bit build run the following commands from the Visual Studio command prompt:
set PATH=%PATH%;C:\Program Files\nasm cd C:\grr-build\openssl-1.0.1e perl Configure VC-WIN64A --prefix=C:\grr-build\openssl ms\do_win64a.bat nmake -f ms\ntdll.mak nmake -f ms\ntdll.mak install
Note that a \ at the end of the prefix path --prefix=C:\grr-build\openssl can cause nmake -f ms\ntdll.mak install to fail.
This will install openssl in C:\grr-build\openssl
Copy C:\grr-build\openssl\bin\libeay32.dll and C:\grr-build\openssl\bin\ssleay32.dll to C:\Python27\lib\site-packages\.
Download the M2Crypto source from: M2Crypto
Download the patch from: http://code.google.com/p/grr/downloads/detail?name=m2crypto-fixes.patch
To apply the patch run the following commands:
cd C:\grr-build\M2Crypto-0.21.1 patch -u -p0 < m2crypto-fixes.patch
- replace self.openssl = 'C:\pkg' by self.openssl = 'C:\grr-build\openssl'
- replace name = 'M2Crypto.__m2crypto' , by name = '__m2crypto'
set PATH=%PATH%;C:\grr-build\swigwin-2.0.9 C:\Python27\python.exe setup.py build C:\Python27\python.exe setup.py install
To get M2Crypto to work for PyInstaller:
- Rename C:\Python27\lib\site-packages\M2Crypto-0.21.1-py2.7-win32.egg to C:\Python27\lib\site-packages\M2Crypto-0.21.1-py2.7-win32.egg.zip
- extract M2Crypto-0.21.1-py2.7-win32.egg.zip into C:\Python27\lib\site-packages\ without a M2Crypto-0.21.1-py2.7-win32.egg sub directory
- remove M2Crypto-0.21.1-py2.7-win32.egg.zip
You may have issues with getting M2Crypto to run. Test by running:
C:\python27\python.exe -c "import M2Crypto"
I get the error:
ImportError: DLL load failed: The specified module could not be found.
The import cannot find: libeay32.dll and/or ssleay32.dll make sure they are in C:\Python27\lib\site-packages\