m2crypto:未定义的符号:sslv3_method

时间:2018-01-27 08:19:24

标签: ubuntu-16.04 m2crypto

我尝试安装M2Crypto:

pip install M2Crypto

但是当我尝试导入M2Crypto时出现错误:

>>> import M2Crypto
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python2.7/dist-packages/M2Crypto/__init__.py", line 26, in 
    from M2Crypto import (ASN1, AuthCookie, BIO, BN, DH, DSA, EVP, Engine, Err,
  File "/usr/local/lib/python2.7/dist-packages/M2Crypto/ASN1.py", line 15, in 
    from M2Crypto import BIO, m2, util
  File "/usr/local/lib/python2.7/dist-packages/M2Crypto/BIO.py", line 10, in 
    from M2Crypto import m2, six, util
  File "/usr/local/lib/python2.7/dist-packages/M2Crypto/m2.py", line 30, in 
    from M2Crypto.m2crypto import *
  File "/usr/local/lib/python2.7/dist-packages/M2Crypto/m2crypto.py", line 26, in 
    _m2crypto = swig_import_helper()
  File "/usr/local/lib/python2.7/dist-packages/M2Crypto/m2crypto.py", line 22, in swig_import_helper
    _mod = imp.load_module('_m2crypto', fp, pathname, description)
ImportError: /usr/local/lib/python2.7/dist-packages/M2Crypto/_m2crypto.so: undefined symbol: sslv3_method

1 个答案:

答案 0 :(得分:2)

如果你使用ubuntu,你应该使用apt服务器的m2crypto(python-m2crypto),它是用所有必要的依赖项构建的:

pip uninstall M2crypto # remove the current error version
apt install python-m2crypto -y # install new version from the repo