Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install SSL for python 2.5 on Debian Linux?

Question

How do I install SSL for Python 2.5 on Debian?

I have tried:

sudo easy_install ssl

But getting:

$ 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

Solution

sudo apt-get install libbluetooth-dev
sudo rm /usr/lib/python2.5/site-packages/ssl/__init__.pyc 
like image 501
dan Avatar asked Jan 21 '23 18:01

dan


2 Answers

For reference, you must install libbluetooth-dev.

like image 76
jcayzac Avatar answered Jan 27 '23 19:01

jcayzac


In fact, you shouldn't compile your own version of python ssl module for several reasons:

  • you won't get automatic security updates of your python ssl module;
  • you won't get smooth upgrade path if you decide to upgrade Debian system on your server.

The best way to obtain python ssl module is to install it from official Debian repositories using apt-get:

apt-get install python-openssl

Hope this helps.

like image 39
thor Avatar answered Jan 27 '23 19:01

thor