py-m2crypto cannot import __m2crypto.so
The current py-m2crypto doesn’t work. Trying to import module gives an import error about __m2crypto.so library.
>>> import M2Crypto
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/M2Crypto/__init__.py", line 22, in <module>
import _m2crypto
File "/usr/lib/python2.7/site-packages/M2Crypto/_m2crypto.py", line 21, in <module>
__m2crypto = swig_import_helper()
File "/usr/lib/python2.7/site-packages/M2Crypto/_m2crypto.py", line 20, in swig_import_helper
return importlib.import_module('__m2crypto')
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named __m2crypto
As a side note. Even manually taking care of importing the library (by
fiddling with import paths) doesn’t really solve the problem, as the
SSLv3_method
symbol is not there.
/ # cd /usr/lib/python2.7/site-packages/M2Crypto/
/usr/lib/python2.7/site-packages/M2Crypto # python
Python 2.7.12 (default, Nov 3 2016, 14:08:35)
[GCC 6.2.1 20160822] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import M2Crypto
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/M2Crypto/__init__.py", line 22, in <module>
import _m2crypto
File "/usr/lib/python2.7/site-packages/M2Crypto/_m2crypto.py", line 21, in <module>
__m2crypto = swig_import_helper()
File "/usr/lib/python2.7/site-packages/M2Crypto/_m2crypto.py", line 20, in swig_import_helper
return importlib.import_module('__m2crypto')
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: Error relocating ./__m2crypto.so: SSLv3_method: symbol not found
Example can be shown in attached files. Log from the docker image and minimal Dockerfile used to generate the example.
Luckily it is possible to install it via pip.
(from redmine: issue id 6467, created on 2016-11-17, closed on 2017-05-22)
- Uploads: