添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Hi guys,

my flask app does not load an installed module. How can I fix that? Here is what I did:

1) Go to bash console 2) workon my-virtualenv 3) pip install Flask-Cors 4) Go to mysite/flask_app.py 5) Add from flask_cors import CORS, cross_origin 6) Run app 7) Getting result:

Traceback (most recent call last): File "/home/ehlersanalytics/mysite/flask_app.py", line 5, in <module> from flask_cors import CORS, cross_origin ModuleNotFoundError: No module named 'flask_cors'

Hi guys,

got a similar problem now that wasn't fixed by the shebang. I have installed keras and verified that it is really there in the virtualenv (see below). But when I import it I get the error below stating that the module was not found. What am I missing here?

Error Log

ModuleNotFoundError: No module named 'keras'

Shebang

1
#!/home/ehlersanalytics/.virtualenvs/my-virtualenv/bin/python3.6

Installed packages

16:36 ~ $ workon my-virtualenv
(my-virtualenv) 16:37 ~ $ pip freeze
-f /usr/share/pip-wheels
click==6.7
Flask==1.0.2
Flask-Cors==3.0.6
h5py==2.8.0
itsdangerous==0.24
Jinja2==2.10
Keras==2.2.2
Keras-Applications==1.0.4
Keras-Preprocessing==1.0.2
MarkupSafe==1.0
numpy==1.14.5
pandas==0.23.1
python-dateutil==2.7.3
pytz==2018.5
PyYAML==3.13
scikit-learn==0.19.1
scipy==1.1.0
six==1.11.0
sklearn==0.0
Werkzeug==0.14.1
(my-virtualenv) 16:37 ~ $

Cheers

[edit by admin: formatting]

Sorry, we have had to rate-limit your feedback sending.
Please try again in a few moments... Thanks for the feedback! Our tireless devs will get back to you soon.