ubuntu16 python2 安装M2Crypto报错

发布时间 2023-06-02 14:21:18作者: BrianSun

正文

pip2 install M2Crypto
# 报错:
# unable to execute 'swig': No such file or directory
# error: command 'swig' failed with exit status 1
# 解决:
sudo apt install swig

# 继续 pip2 install M2Crypto,又报错:
# src/SWIG/_m2crypto_wrap.c:149:21: fatal error: Python.h: 没有那个文件或目录
# 解决:
apt-get install python-dev

pip2 install M2Crypto
# 安装成功