Cannot start on 16.04 with requests/SSL related import error

Bug #1609548 reported by Peter Levi
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Variety
New
Medium
Unassigned

Bug Description

Hello,

After latest update of Variety on Ubuntu 16.04, it won’t launch. I’m getting this when I try to launch in Terminal, can you help?

/usr/lib/python2.7/dist-packages/variety/__init__.py:105: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version(‘Gtk’, ‘3.0’) before import to ensure that the right version gets loaded.
from gi.repository import Gtk, Gdk, GObject # pylint: disable=E0611
Traceback (most recent call last):
File “/usr/bin/variety”, line 38, in
import variety
File “/usr/lib/python2.7/dist-packages/variety/__init__.py”, line 107, in
from variety import VarietyWindow
File “/usr/lib/python2.7/dist-packages/variety/VarietyWindow.py”, line 22, in
from variety.FacebookHelper import FacebookHelper
File “/usr/lib/python2.7/dist-packages/variety/FacebookHelper.py”, line 55, in
from variety.Util import Util
File “/usr/lib/python2.7/dist-packages/variety/Util.py”, line 17, in
import requests
File “/usr/local/lib/python2.7/dist-packages/requests/__init__.py”, line 53, in
from .packages.urllib3.contrib import pyopenssl
File “/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/contrib/pyopenssl.py”, line 73, in
ssl.PROTOCOL_SSLv3: OpenSSL.SSL.SSLv3_METHOD,
AttributeError: ‘module’ object has no attribute ‘PROTOCOL_SSLv3’

Many thanks,

Peter.

Revision history for this message
Peter Levi (peterlevi) wrote :

Do you have python-openssl installed?
Can you try installing it and trying again please?

Revision history for this message
Peter Levi (peterlevi) wrote :

(sudo apt-get install python-openssl)

Revision history for this message
Peter Sefton (peterjsefton) wrote :

Thanks Peter, yes I appear to have python-openssl already installed,

Revision history for this message
Peter Levi (peterlevi) wrote :

Hm, yes, actually it seems to be something with urllib3: http://stackoverflow.com/questions/28987891/patch-pyopenssl-for-sslv3-issue

What's the output of these:
apt-cache show python-requests
python -c "import requests; import urllib3; print requests.__version__; print urllib3.__version__"

Revision history for this message
Peter Sefton (peterjsefton) wrote :

Sorry for the delay, here's the output,

peter@peter-LIFEBOOK-AH512:~$ apt-cache show python-requests
Package: python-requests
Priority: optional
Section: python
Installed-Size: 248
Maintainer: Ubuntu Developers <email address hidden>
Original-Maintainer: Debian Python Modules Team <email address hidden>
Architecture: all
Source: requests
Version: 2.9.1-3
Depends: python-urllib3 (>= 1.13.1), python:any (<< 2.8), python:any (>= 2.7.5-5~), ca-certificates, python-chardet, python-urllib3 (<< 1.13.2)
Suggests: python-ndg-httpsclient, python-openssl, python-pyasn1
Breaks: httpie (<< 0.9.2)
Filename: pool/main/r/requests/python-requests_2.9.1-3_all.deb
Size: 55552
MD5sum: 8b7ef5daeec5fdf8dbe5ce86d874f9d0
SHA1: ecf947758cab121b6777493994c0909b85a858f9
SHA256: 9c8ece120617d7cb8c7653012756c6a66db7c4b02786e3e6e9b0593222cd6b1d
Description-en: elegant and simple HTTP library for Python2, built for human beings
 Requests allow you to send HTTP/1.1 requests. You can add headers, form data,
 multipart files, and parameters with simple Python dictionaries, and access
 the response data in the same way. It's powered by httplib and urllib3, but
 it does all the hard work and crazy hacks for you.
 .
 Features
 .
   - International Domains and URLs
   - Keep-Alive & Connection Pooling
   - Sessions with Cookie Persistence
   - Browser-style SSL Verification
   - Basic/Digest Authentication
   - Elegant Key/Value Cookies
   - Automatic Decompression
   - Unicode Response Bodies
   - Multipart File Uploads
   - Connection Timeouts
Description-md5: 3f93f5c41e878a095fe3d86ea9983e58
Homepage: http://python-requests.org
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 5y
Task: edubuntu-desktop-gnome, ubuntustudio-audio, ubuntu-gnome-desktop, ubuntu-sdk, ubuntu-mate-desktop

and

peter@peter-LIFEBOOK-AH512:~$ python -c "import requests; import urllib3; print requests.__version__; print urllib3.__version__"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/requests/__init__.py", line 53, in <module>
    from .packages.urllib3.contrib import pyopenssl
  File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 73, in <module>
    ssl.PROTOCOL_SSLv3: OpenSSL.SSL.SSLv3_METHOD,
AttributeError: 'module' object has no attribute 'PROTOCOL_SSLv3'

Revision history for this message
Peter Levi (peterlevi) wrote :

Thanks! What about just
python -c "import urllib3; print urllib3.__version__"

Revision history for this message
Peter Sefton (peterjsefton) wrote :

It's

1.13.1

Revision history for this message
Peter Sefton (peterjsefton) wrote :

Variety now working perfectly, I used the following commands from the link you gave:

pip install requests==2.6.0

and

sudo easy_install --upgrade pip

Happiness! Thanks very much :)

Revision history for this message
edA-qa (eda-qa) wrote :

`pip install requests==2.6.0` also worked for me. Variety had stopped working after a recent Ubuntu 16.04 upgrade.

Revision history for this message
edA-qa (eda-qa) wrote :

Actually I just did `sudo pip install --upgrade requests` without specifying a version.

James Lu (jlu5)
Changed in variety:
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.