Numpy ImportError when deploying Flask App using mod_wsgi/Apache2

非 Y 不嫁゛ 提交于 2019-12-01 18:31:08

This:

site.addsitedir('/home/ubuntu/.local/lib/python2.7/site-packages/numpy')

should have been:

site.addsitedir('/home/ubuntu/.local/lib/python2.7/site-packages')

But the whole way you are setting up Python virtual environments is not best practice anyway. Suggest you read:

Also try and switch to daemon mode, it is better to use daemon mode than embedded mode.

numpy via pip is not installed at /home/ubuntu/.local/lib/python2.7/site-packages but it should be at /home/ubuntu/.local/lib64/python2.7/site-packages or something like that.

Just try add another site.addsitedir in your app.wsgi to that folder should work. Something like this :

site.addsitedir('/home/ubuntu/.local/lib64/python2.7/site-packages')

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!