Hi,
In recent versions I started getting this error when trying to import uwsgi into a python script:
ImportError: No module named uwsgi
I tested this on uWSGI 2.0.11.1 and 2.0.11.2
Here are the steps to reproduce:
pip install uwsgi
python -c 'import uwsgi'
According to https://uwsgi-docs.readthedocs.org/en/latest/Install.html I should been able to run pip install uwsgi and import it into my python script, but the uwsgi lib is never installed in site-packages
Il 15/10/2015 23:29, Bastian Kuberek ha scritto:
According to https://uwsgi-docs.readthedocs.org/en/latest/Install.html I should
been able to run |pip install uwsgi| and import it intop my python script, but
the uwsgi lib is never installed in site-packages
Hello, in that page there's no mention of uwsgi a generally available python
module. It's exported by the uwsgi process itself through the python plugin. So
it's available in your app but not on your shell.
Riccardo Magliocchetti
@rmistaken
Oh ok. Thanks for clarifying that.
My use case is tests: some of them don't run under the uwsgi context, but when trying to import uwsgi it fails trying to import the module.
Is there any work around to this?
I have the same question . Did you solve it ?
@mxjily - my solution eventually was to wrap the uwsgi with try/except and ensure in the tests to mock it.
Not ideal, but did the trick.
OK,Thank you
@nvgoldin - can you show the pattern how you mocked the import uwsgi in the test context? we are using uwsgi.is_connected() api on the server to verify if client holds a connection and simulate server thread timeout/termination if takes too long.
Most helpful comment
Il 15/10/2015 23:29, Bastian Kuberek ha scritto:
Hello, in that page there's no mention of uwsgi a generally available python
module. It's exported by the uwsgi process itself through the python plugin. So
it's available in your app but not on your shell.
Riccardo Magliocchetti
@rmistaken
http://menodizero.it