Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: No module named flask_restful

I am trying to deploy appengine flex python app but getting the following in Stackdriver log stderr after deployment

  File "/env/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 578, in spawn_worker
    worker.init_process()
  File "/env/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 126, in init_process
    self.load_wsgi()
  File "/env/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 135, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/env/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/env/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
    return self.load_wsgiapp()
  File "/env/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/env/local/lib/python2.7/site-packages/gunicorn/util.py", line 352, in import_app
    __import__(module)
  File "/home/vmagent/app/my_service/entry_point.py", line 5, in <module>
    import flask_restful as restful
ImportError: No module named flask_restful

entry_point.py in line 5 has

import flask_restful as restful

And my requirement.txt has

Flask-RESTful==0.3.6
gunicorn==19.7.1

Not sure why its still complaining about Flask-Restful

like image 825
Neil Avatar asked Jul 06 '18 15:07

Neil


People also ask

How do I know if flask is installed?

Check flask Version Windows To check which version of flask is installed, use pip show flask or pip3 show flask in your Windows CMD, command line, or PowerShell.


1 Answers

ImportError: No module named flask_restful

Seems that you don't have flask_restful installed, to install run:

pip install flask-restful

in your Terminal and then run your app.

Documentation: https://flask-restful.readthedocs.io/en/latest/installation.html

like image 156
Treedbox Avatar answered Sep 18 '22 17:09

Treedbox