繁体   English   中英

如何在Debian Linux上为python 2.5安装SSL?

[英]How to install SSL for python 2.5 on Debian Linux?

如何在Debian上为Python 2.5安装SSL?

我努力了:

sudo easy_install ssl

但得到:

$ python setup.py build
looking for /usr/include/openssl/ssl.h
looking for /usr/include/krb5.h
running build
running build_py
running build_ext
building 'ssl._ssl2' extension
creating build/temp.linux-i686-2.5
creating build/temp.linux-i686-2.5/ssl
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I./ssl/2.5.1 -I/usr/include/python2.5 -c ssl/_ssl2.c -o build/temp.linux-i686-2.5/ssl/_ssl2.o
In file included from ssl/_ssl2.c:75:
./ssl/2.5.1/socketmodule.h:45:33: error: bluetooth/bluetooth.h: No such file or directory
./ssl/2.5.1/socketmodule.h:46:30: error: bluetooth/rfcomm.h: No such file or directory
./ssl/2.5.1/socketmodule.h:47:29: error: bluetooth/l2cap.h: No such file or directory
./ssl/2.5.1/socketmodule.h:48:27: error: bluetooth/sco.h: No such file or directory
In file included from ssl/_ssl2.c:75:
./ssl/2.5.1/socketmodule.h:98: error: field ‘bt_l2’ has incomplete type
./ssl/2.5.1/socketmodule.h:99: error: field ‘bt_rc’ has incomplete type
./ssl/2.5.1/socketmodule.h:100: error: field ‘bt_sco’ has incomplete type
error: command 'gcc' failed with exit status 1

sudo apt-get install libbluetooth-dev
sudo rm /usr/lib/python2.5/site-packages/ssl/__init__.pyc 

作为参考,您必须安装libbluetooth-dev

实际上,您不应该编译自己的python ssl模块版本,原因如下:

  • 您将无法获得python ssl模块的自动安全更新;
  • 如果您决定在服务器上升级Debian系统,则无法获得平滑的升级路径。

获取python ssl模块的最佳方法是使用apt-get从官方Debian存储库安装它:

apt-get install python-openssl

希望这可以帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM