Elteroooo
Elteroooo

Reputation: 3081

Python M2Crypto DLLs load failed, The specified module could not be found

I'm trying to use this slice for my web2py app http://www.web2pyslices.com/slices/take_slice/106

i installed the module M2Crypto and followed the slice, when loading the page i receive this error

Traceback (most recent call last):
  File "F:\Projects\Web2py\w1992\gluon\restricted.py", line 194, in restricted
    exec ccode in environment
  File "F:\Projects\Web2py\w1992\applications\internet2letter\views\account/order.html", line 102, in <module>
  File "F:\Projects\Web2py\w1992\gluon\custom_import.py", line 294, in __call__
    fromlist, level)
  File "F:\Projects\Web2py\w1992\gluon\custom_import.py", line 78, in __call__
    level)
  File "applications\internet2letter\modules\crypt.py", line 2, in <module>
    from M2Crypto import BIO, SMIME, X509, EVP
  File "F:\Projects\Web2py\w1992\gluon\custom_import.py", line 294, in __call__
    fromlist, level)
  File "F:\Projects\Web2py\w1992\gluon\custom_import.py", line 78, in __call__
    level)
  File "C:\Python27\lib\site-packages\M2Crypto\__init__.py", line 22, in <module>
    import __m2crypto
  File "F:\Projects\Web2py\w1992\gluon\custom_import.py", line 294, in __call__
    fromlist, level)
  File "F:\Projects\Web2py\w1992\gluon\custom_import.py", line 78, in __call__
    level)
ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden.

so i tried to import the module from Python direcktly i opened the terminal and put

>>> import M2Crypto
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\M2Crypto\__init__.py", line 23, in <module
>
    import m2
  File "C:\Python27\lib\site-packages\M2Crypto\m2.py", line 28, in <module>
    from __m2crypto import *
ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden.
>>>

anyway to solve this ??

Upvotes: 3

Views: 3808

Answers (2)

LeXIkA333
LeXIkA333

Reputation: 11

Solved: In order to use modules that are compatible with python 2.7 and to avoid the Error indicated in the post, it is necessary to have the following Microsofot Visual Studio libraries (all MV C++ version that are listed): from 2008- 2022 + including the 2010 tools (also listed) + Microsoft Visual C++ Compiler Package for Py 2.7 enter image description here

Upvotes: 0

Olson
Olson

Reputation: 1963

Had the same problem, fixed it by installing OpenSSL for Windows from here: http://slproweb.com/products/Win32OpenSSL.html

I used OpenSSL v1.0.1b (DLLs installed to system dir) with M2Crypto 0.21.1 and Python 2.7.3 (all 32 versions) no problem.

Upvotes: 2

Related Questions