transport.close()
--------------------------------------------------------------
安装过程中遇到的错误记录如下:
一、安装cffi-1.11.2报错如下
1、
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
百度查询是因为查找不到libffi.pc,使用find / -name libffi.pc命令查找,然后将libffi.pc文件拷贝到/usr/lib64/pkgconfig(32位Linux是/usr/lib/pkgconfig),问题解决
2、
c/_cffi_backend.c:15:17: error: ffi.h: No such file or directory
In file included from c/_cffi_backend.c:92:
通过安装libffi-3.0.9-1.3.x86_64.rpm和libffi-devel-3.0.9-1.3.x86_64.rpm解决,第一个问题应该也可以通过这种方式解决,但遇到第2个问题时已经将第一个解决
二、安装cryptography-2.1.1报错
build/temp.linux-x86_64-3.6/_openssl.c:483:30: error: openssl/opensslv.h: No such file or directory
缺失文件,安装openssl-devel解决
yum install openssl-devel*
Downloading Packages:
(1/7): keyutils-libs-devel-1.4-5.el6.x86_64.rpm
(2/7): krb5-devel-1.10.3-42.el6.x86_64.rpm
(3/7): libcom_err-devel-1.41.12-22.el6.x86_64.rpm
(4/7): libselinux-devel-2.0.94-5.8.el6.x86_64.rpm
(5/7): libsepol-devel-2.0.41-4.el6.x86_64.rpm
(6/7): openssl-1.0.1e-48.el6_8.1.x86_64.rpm
(7/7): openssl-devel-1.0.1e-48.el6_8.1.x86_64.rpm
三、安装完成后运行出错,提示No module named '_ssl'
这是由于之前在编译安装python3.6的时候,系统还未安装ssl相关模块,python3.6在编译过程检测不到该模块,就会将ssl支持功能略过。第二个问题中安装的openssl-devel已将ssl模块安装好了,如果没有可以再执行下
yum -y install openssl openssl-devel
然后重新编译安装python3.6,问题解决。
主:2.*版本的python需要修改setup.py增加ssl配置才能解决这个问题,或者在编译时加 --with-ssl
-----------------------------------------------------------