python2 python3 m2crypto 安装(rsa 私钥文件加密)

转自作者:大道至简_Andy

原文链接:https://www.jianshu.com/p/b308357ef649

第一种方式:使用apt-get(以Python2版本进行测试的)

  1. sudo apt-get install python-m2crypto, M2Crypto将安装到系统Python库中。

第二种方式:从源码进行安装((兼容Python2,3))

  1. sudo apt-get install build-essential python3-dev python-dev libssl-dev swig

  2. pip install https://gitlab.com/m2crypto/m2crypto/repository/python3/archive.tar.gz

第三种方式:pip安装(不兼容Python3)

  1. pip install M2Crypto

以上安装方式在下列系统中的Python版本测试通过:

Debian 7.11, 8.8, 9.2

  Python 2.7.11, 2.7.13, 2.7.14, 3.5.4, 3.6.3

Ubuntu 16.04.3 LTS

  Python 2.7.3, 2.7.9, 2.7.11, 2.7.13, 2.7.14, 3.5.4, 3.6.3

原文地址:https://www.cnblogs.com/shmily3929/p/8117258.html