How do I configure multiple Ubuntu Python installations to avoid App Engine's SSL error?

Posted by Linc on Stack Overflow See other posts from Stack Overflow or by Linc
Published on 2010-05-01T05:05:58Z Indexed on 2010/05/01 5:17 UTC
Read the original article Hit count: 288

I have Karmic Koala which has Python 2.6 installed by default.

However I can't run any Python App Engine projects because they require Python 2.5 and python ssl.

To install ssl I installed python2.5-dev first while following some instructions I found elsewhere.

sudo apt-get install libssl-dev
sudo apt-get install python-setuptools
sudo apt-get install python2.5-dev 
sudo easy_install-2.5 pyopenssl

However, I am afraid this is not good for my Ubuntu installation since Ubuntu expects to see version 2.6 of Python when you type 'python' on the command line. Instead, it says '2.5.5'.

I tried to revert to the original default version of Python by doing this:

sudo apt-get remove python2.5-dev 

But that didn't seem to do anything either - when I type 'python' on the command line it still say 2.5.5.

And App Engine still doesn't work after all this. I continue to get an SSL-related error whenever I try to run my Python app:

AttributeError: 'module' object has no attribute 'HTTPSHandler'

UPDATE: Just checked whether SSL actually installed as a result of those commands by typing this:

$ python2.5
Python 2.5.5 (r255:77872, Apr 29 2010, 23:59:20) 
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named ssl
>>> 

As you can see, SSL is still not installed, which explains the continuing App Engine error.

If anyone knows how I can dig myself out of this hole, I would appreciate it.

© Stack Overflow or respective owner

Related posts about python

Related posts about google-app-engine