ImportError: cannot import name SSLError

This is the place for queries that don't fit in any of the other categories.

ImportError: cannot import name SSLError

Postby drpaneas » Sat Jan 04, 2014 10:24 pm

I need the SSLError utility function but ...

Code: Select all
from requests.exceptions import SSLError


and I get ImportError: cannot import name SSLError :(

PS: I have installed python-requests in Ubuntu using the python-requests package
Far over the Misty Mountains cold, to dungeons deep and caverns old
--> My Python tutorial for beginners <--
User avatar
drpaneas
 
Posts: 6
Joined: Thu Dec 26, 2013 4:00 am
Location: Thessaloniki, GR

Re: ImportError: cannot import name SSLError

Postby metulburr » Sat Jan 04, 2014 10:51 pm

do you have these libs:
viewtopic.php?f=10&t=9915
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1560
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: ImportError: cannot import name SSLError

Postby drpaneas » Sat Jan 04, 2014 11:01 pm

I am using Python 2.7.3
is this module available for Python 2.x or I have to use Python 3.x instead ?

PS: Yes, openssl and libssl-dev are already installed

I am using Python 2.7.3.
However,
Code: Select all
from requests import exceptions

works without problem.

My professor told me to use SSLError, I don't know if ssl and SSLError are similar. Hm ?


If it helps:
Code: Select all
requests.__version__

is 0.8.2

and the
Code: Select all
request.exceptions.__file__

is /usr/lib/python2.7/dist-packages/requests/exceptions.pyc

--------------------------------------------------- EDIT ---------------------------------------------------
Answer: My requests library version is too old. The SSLError exception was not added to requests.exceptions until version 0.8.8, in revision 9a1a413.
Far over the Misty Mountains cold, to dungeons deep and caverns old
--> My Python tutorial for beginners <--
User avatar
drpaneas
 
Posts: 6
Joined: Thu Dec 26, 2013 4:00 am
Location: Thessaloniki, GR


Return to General Coding Help

Who is online

Users browsing this forum: Bing [Bot] and 2 guests