ImportError: no module named tornado.wsgi

I am running python 2.7 on ubuntu 12.04. I did pip install tornadoin a virtual environment, and python reports that it was a successful installation. But when I run the code in the file tserver.py, I get the following error:

(venv)$ python tserver.py 
Traceback (most recent call last):
  File "tserver.py", line 1, in <module>
    from tornado.wsgi import WSGIContainer
ImportError: No module named tornado.wsgi

I found this question describing a very similar Python Tornado problem : is the WSGI module missing? - but my file is not called tornado.py, so the answer does not help me.

+4
source share
1 answer

Should you name the server file initially as tornado.py? because, I had and even after the change, I still got this error.

I fixed it after I did sudo pip install tornado --upgrade

. python import tornado, .

tornado.pyc tornado.py , .

+1

Source: https://habr.com/ru/post/1535934/


All Articles