Python 烧瓶+;uwsgi&x2B;nginx+;centos错误导入模块numpy

Python 烧瓶+;uwsgi&x2B;nginx+;centos错误导入模块numpy,python,numpy,flask,uwsgi,Python,Numpy,Flask,Uwsgi,带numpy的virtualenv中的python 3.6 当我启动服务时: r-python uwsgi[9729]: def empty_like(prototype, dtype=None, order=None, subok=None): r-python uwsgi[9729]: File "/home/user01/python/conserva/conservaenv/lib64/python3.6/site-packages/numpy/core/overrides.py", l

带numpy的virtualenv中的python 3.6

当我启动服务时:

r-python uwsgi[9729]: def empty_like(prototype, dtype=None, order=None, subok=None):
r-python uwsgi[9729]: File "/home/user01/python/conserva/conservaenv/lib64/python3.6/site-packages/numpy/core/overrides.py", line 240, in decorator
r-python uwsgi[9729]: docs_from_dispatcher=docs_from_dispatcher)(implementation)
r-python uwsgi[9729]: File "/home/user01/python/conserva/conservaenv/lib64/python3.6/site-packages/numpy/core/overrides.py", line 204, in decorator
r-python uwsgi[9729]: add_docstring(implementation, dispatcher.__doc__)
r-python uwsgi[9729]: RuntimeError: empty_like method already has a docstring
r-python uwsgi[9729]: VACUUM: unix socket conserva.sock removed.
r-python systemd[1]: conserva.service: main process exited, code=exited, status=22/n/a
r-python systemd[1]: Unit conserva.service entered failed state.
r-python systemd[1]: conserva.service failed.

如果我从应用程序代码中删除“import numpy”,服务将运行。问题是什么?如何修复它?

我在uWSGI下运行导入numpy的项目时遇到了这个问题。uWSGIs使用的默认子解释器与numpy的初始化之间存在一些交互

您可以告诉uWSGI不要在您的uWSGI配置中使用子解释器,行为:

single-interpreter = true

添加到何处取决于您如何配置uWSGI。

关于
wsgi.py
文件配置文档: