nickb84
nickb84

Reputation: 641

flask+uwsgi+nginx+centos error import module numpy

python 3.6 in virtualenv with numpy

when i start the service:

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.

if i remove the 'import numpy' from the app code, the service run. Which is the problem? how can i fix it?

Upvotes: 1

Views: 590

Answers (1)

Sukru Kaymakcalan
Sukru Kaymakcalan

Reputation: 46

I've run into this while running projects under uWSGI that import numpy. There is some interaction between the default sub interpreters that uWSGIs uses and numpy's initialization.

You can tell uWSGI to not use sub interpreters in your config for uWSGI with the line:

single-interpreter = true

Where to add this will depend on how you configured uWSGI.

Upvotes: 3

Related Questions