簡體   English   中英

flask+uwsgi+nginx+centos 錯誤導入模塊numpy

[英]flask+uwsgi+nginx+centos error import module numpy

帶有 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。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM