安装pyOpenSSL == 0.13.x时提示“OpenSSL/crypto/crl.c:6:23: error: static declaration of ‘X509_REVOKED_dup’ follows non-static declaration static X509_REVOKED * X509_REVOKED_dup(X509_REVOKED *orig)”解决方式

 pip  安装pyOpenSSL == 0.13.x时提示“OpenSSL/crypto/crl.c:6:23: error: static declaration of ‘X509_REVOKED_dup’ follows non-static declaration static X509_REVOKED * X509_REVOKED_dup(X509_REVOKED *orig)”解决方式已关闭评论
12月 242020
 

今天需要安装老的0.13版本的pyOpenSSL时出现下面错误“

OpenSSL/crypto/crl.c:6:23: error: static declaration of ‘X509_REVOKED_dup’ follows non-static declaration
static X509_REVOKED * X509_REVOKED_dup(X509_REVOKED *orig)”

 

结合网上资料可以使用下面的步骤即可完成安装:

1.#新建一个目录build

[[email protected]] mkdir build

[[email protected]] cd build

 

2. #然后下载pyOpenSSL==0.13的源码,解压后
[[email protected]] pip download pyOpenSSL==0.13
[[email protected]] tar xzf pyOpenSSL-0.13.tar.gz

 

3.#修改OpenSSL/crypto/crl.c文件
[[email protected]] cd pyOpenSSL-0.13

[[email protected]] vi OpenSSL/crypto/crl.c

找到这一行
static  X509_REVOKED * X509_REVOKED_dup(X509_REVOKED *orig) {

删除static,修改为:

X509_REVOKED * X509_REVOKED_dup(X509_REVOKED *orig) {

 

4.#然后再安装

[[email protected]] pip install –no-clean .

 

DONE!!!

pip安装包到指定目录方法(指定路径)

 mac, pip, python  pip安装包到指定目录方法(指定路径)已关闭评论
10月 242019
 

mac中使用pip安装包后,可能会发现明明提示“Successfully installed xxx“,但就是找不到这个包“ImportError: No module named  xxx”?

其实是这样: 默认pip安装在/usr/local/lib/python2.7/site-packages, 但如果sudo pip安装则会安装在/lib/python2.7/site-packages,那如果我要指定安装包的路径需要怎么做呢?使用下面的黑体字命令即可,在-install-option里添加–install-purelib指定目录即可,以下命令安装google-api-python-client包到/usr/local/lib/python2.7/site-packages

pip install --install-option="--install-purelib=/usr/local/lib/python2.7/site-packages" google-api-python-client

 

DONE!!!