Problems Installing M2Crypto on Mint: Next Steps

I asked a question here regarding installing the Python M2Crypto library in Mint. This question was answered successfully, and I was able to create and install M2Crypto. However, I cannot use it in Python. when I try to import a module, I get the following error:

>>> import M2Crypto Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/M2Crypto/__init__.py", line 22, in <module> import __m2crypto ImportError: /usr/local/lib/python2.7/dist-packages/M2Crypto/__m2crypto.so: undefined symbol: SSLv2_method 

If anyone knows how to resolve this error, please let me know.

+4
source share
3 answers

It seems like this is a bug introduced in M2Crypto 0.21.1, there is a patch here that fixes the problem.

Perhaps you could try to install the old version of M2Crypto (for example, 0.20.1-1.1) or apply the patch manually using patch .

+2
source

Two years later, the problem in m2crypto0.21.1 still exists, so there is a note here for Ubuntu users. If you are not using virtualenv , you can easily fix this by installing m2crypto from Ubuntu PPA instead of pip:

 sudo pip uninstall m2crypto sudo apt-get install python-m2crypto 

It looks like the problem is fixed in the PPA, but not in the project repo. At least this worked for me on Ubuntu 12.04.

+15
source

To expand the answer above:

This is a bug in M2Crypto 0.21.1. This is because SSLv2 has been removed from OpenSSL on many platforms on the grounds that it is too insecure, especially Debian [ 1 ] and Ubuntu.

Deletion during compilation was not detected. There is a widespread patch that fixes this. I have included it in the source code of M2Crypto on Github.

You can use pip to install directly from the repository as follows:

 pip install -e git+https://github.com/Hypernode/m2crypto#egg=M2Crypto 

For those who want to check out a (published) patch that fixes this: b432d36

Edit: moved to another location

+3
source

Source: https://habr.com/ru/post/1412002/


All Articles