On a fresh installed machine (win10 64 bit), I installed python 2.7.11 (64 bit) and now installed M2Crypto using pip install --egg M2CryptoWin64
however, trying to import this gives the following error (verbose trace):
>>> import M2Crypto
# C:\Python27\lib\encodings\cp850.pyc matches C:\Python27\lib\encodings\cp850.py
import encodings.cp850 # precompiled from C:\Python27\lib\encodings\cp850.pyc
import M2Crypto # directory C:\Python27\lib\site-packages\M2Crypto
# C:\Python27\lib\site-packages\M2Crypto\__init__.pyc matches C:\Python27\lib\site-packages\M2Crypto\__init__.py
import M2Crypto # precompiled from C:\Python27\lib\site-packages\M2Crypto\__init__.pyc
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\M2Crypto\__init__.py", line 22, in <module>
import __m2crypto
ImportError: DLL load failed: The specified module could not be found.
There is a M2Crypto folder in my site-packages, so what could be wrong here?
Using dependency walker I found out that MSVCR100.DLL
was missing on the computer which is apparently needed. This is part of the Microsoft Visual C++ 2010 SP1 Redistributable Package (x64) which can be downloaded and installed here: https://www.microsoft.com/en-us/download/details.aspx?id=13523
After restarting the command line it now imports successfully.