Cannot start uWSGI server without virtualenv (ImportError)

I am running django + nginx + uwsgi. For some reason, I cannot start uWSGI without setting up a home option, pointing to a virtual environment. Whenever I run uWSGI without it, it says that it cannot find the django.core.wsgi module, for example, if the python path is empty (but django 1.4 is set to system scale).

How can i fix this?

+5
source share
1 answer

Since I also hit my head on this problem, write an answer for everyone. :) The problem is that when launched in emperor mode (on the system), the uwsgi master process cannot (or will not) load the correct environment for python (PYTHONPATH ) Using virtualenv, you specify the environment. Without this, you need to set the variable pythonpath, even several times, pointing to system-wide python paths.

As an example, for my system this is:

pythonpath = /usr/local/lib/python2.7/dist-packages
pythonpath = /usr/lib/python2.7

(using ini syntax)

+16
source

All Articles