0

I'm trying to use UWSGI with a virtualenv. My app ini is:

[uwsgi]
dir             = /var/www/KRAKEN/public/xxx.me/appxx
chdir           = %(dir)
#master          = true
processes       = 1
socket          = /var/run/uwsgi/app/appxx/socket
chmod-socket    = 666
enable-threads  = true
vacuum          = true
plugin          = python34
virtualenv      = /home/gabriel/python_env/appxx/
wsgi-file       = app.py
mount           = /%dir=app.py
logto           = %(dir)/uwsgi.log
py-autoreload   = true

And get:

Set PythonHome to /home/gabriel/python_env/appxx
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'

If i use the standard python version (2.7) by changing the plugin option in the ini, i get:

"no module named site".

Any clues? Thanks!

2
  • You have specified a virtualenv, (/home/gabriel/python_env/appxx/). Is it working correctly? That error is often from a misconfigured PYTHONPATH or other site issues. Jul 3, 2017 at 0:30
  • @StephenRauch hi! Yes, because the log output shows Python 3.4 which is consistent with the pyton version in the venv. The system default is 2.7.
    – Gabriel
    Jul 3, 2017 at 2:28

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.