Tornado: Installing tornado 5.0.1 with Python 2.7 causing ImportError: Tornado requires an up-to-date SSL module

Created on 28 Mar 2018  Β·  13Comments  Β·  Source: tornadoweb/tornado

I am trying to install Tornado 5.0.1, getting this error -
pip install tornado
Collecting tornado
Using cached tornado-5.0.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-t2xMkH/tornado/setup.py", line 146, in
raise ImportError("Tornado requires an up-to-date SSL module. This means "
ImportError: Tornado requires an up-to-date SSL module. This means Python 2.7.9+ or 3.4+ (although some distributions have backported the necessary changes to older versions).

Upgraded python version from 2.7.5 to 2.7.13
Upgraded openssl version from 1.0.1e 2013 to 1.0.2o 2018

Still getting the same error.

The part of code in setup.py from where this error is raised, when i put that in a separate python script and run it, control is not even entering that block.

Previously had tornado 4.5 but needed an upgrade in order to use multiprocessing.
Any help regarding this is deeply appreciated.

other

Most helpful comment

Ended up fixing it with something like python2 -m pip install --user --upgrade ipykernel tornado==4.5.3. (Note that installing a too old tornado version will cause problems like https://github.com/jupyter/help/issues/272)

All 13 comments

That's weird. I have no idea what could be going on. What platform are you on and how did you install/upgrade python? Is there any way the old python is still around and some virtualenv is pointing to it?

Faced the same issue on a VM having RHEL 6.5 and having native Python alongside Python 2.7.5.
When attempting to upgrade Jupyter, it fails to upgrade tornado.

Collecting tornado>=4.0 (from ipykernel->jupyter) Downloading tornado-5.0.2.tar.gz (506kB) 100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 512kB 2.3MB/s Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-build-0Ataep/tornado/setup.py", line 146, in <module> raise ImportError("Tornado requires an up-to-date SSL module. This means " ImportError: Tornado requires an up-to-date SSL module. This means Python 2.7.9+ or 3.4+ (although some distributions have backported the necessary changes to older versions).

As the error reports, perhaps I need to upgrade to Python 2.7.9+

Hi, my friend. I face the same problem. And I have tried a lot of ways, but all of them didn't work. Any ideas?

@GuoleiSun What's your Python version?

Having same issue with python 2.7.14 and (this may be important) fresh pip 10.0.0

Hi,

For me pip was pointing to older version of python, installation of new
python version 2.7.13 and doing get pip after that worked for me

Thanks,
Pramit

On Mon 16 Apr, 2018, 12:11 PM GuoleiSun, notifications@github.com wrote:

Hi, my friend. I face the same problem. And I have tried a lot of ways,
but all of them didn't work. Any ideas?

β€”
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/tornadoweb/tornado/issues/2331#issuecomment-381494974,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ARaMy6zB2YZyIsPDXHNZGxtGUY1mFxmpks5tpD0igaJpZM4S-ITy
.

The same problem here.
On my old VM, I have tornado (4.5.1) and python Python 2.7.6.
The new machine comes with the same python but got an error when installing the latest Tornado

If you have this issue in ubuntu 14.04 with python 2.7.6 you can always use
sudo apt-get install python-tornado
Which wont check for 2.7.9 SSL verfication

You can enter your python shell to check whether ssl module has "SSLContext", "create_default_context" and "match_hostname" attributes:

Python 2.7.9 (default, Jun  4 2018, 08:52:15) 
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>> ssl.SSLContext and ssl.create_default_context and ssl.match_hostname
<function match_hostname at 0x7f7d4717bed8>

If it does,you still need to check whether the pip you used is pointing to the corrent python interpreter:

# pip -V
pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7)

Closing this issue because it seems to be specific to the environment and not tornado-specific.

@bdarnell
the same issue, how to fix it. please help me

Run the following commands. (also shown is the output I get)

head -n1 $(which pip)

!/Users/pierce/scratch/venv2/bin/python

$(head -n1 $(which pip) | cut -d'!' -f2) --version

Python 2.7.16

If you get "Python 2.7.8" or earlier then you need a newer python, and a pip installed for that newer python.

Ended up fixing it with something like python2 -m pip install --user --upgrade ipykernel tornado==4.5.3. (Note that installing a too old tornado version will cause problems like https://github.com/jupyter/help/issues/272)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jonathon-love picture jonathon-love  Β·  5Comments

Lucaszw picture Lucaszw  Β·  5Comments

jvanlangen picture jvanlangen  Β·  4Comments

argaen picture argaen  Β·  5Comments

coldnight picture coldnight  Β·  3Comments