Answer the question
In order to leave comments, you need to log in
ImportError: No module named site - how to fix this and force the ini file to take python3 instead of python2?
The essence of the problem is described in the title.
If I go into a virtual environment where python 3.5 is enabled and run this: uwsgi --ini company_uwsgi.ini
Everything works fine, the project is included. But as soon as you exit the environment and type in the same command, an error pops up.
traceback:
[email protected]:~/Django-u/company_base$ uwsgi --ini company_uwsgi.ini
[uWSGI] getting INI configuration from company_uwsgi.ini
*** Starting uWSGI 2.0.15 (64bit) on [Mon Sep 11 03:28:30 2017] ***
compiled with version: 5.4.0 20160609 on 20 July 2017 18:13:34
os: Linux-4.10.0-33-generic #37~16.04.1-Ubuntu SMP Fri Aug 11 14:07:24 UTC 2017
nodename: anton-X451CA
machine: x86_64
clock source: unix
detected number of CPU cores: 2
current working directory: /home/anton/Django-u/company_base
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
chdir() to /home/anton/Django-u/company_base/
your processes number limit is 15083
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to UNIX address /home/anton/Django-u/company_base/company.sock fd 3
Python version: 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]
Set PythonHome to /home/anton/virtenvs/com_env/
ImportError: No module named site
VACUUM: unix socket /home/anton/Django-u/company_base/company.sock removed.
[uwsgi]
chdir = /home/anton/Django-u/company_base/
module = company_base.wsgi
home = /home/anton/virtenvs/com_env/
master = true
processes = 10
socket = /home/anton/Django-u/company_base/company.sock
chmod-socket = 666
vacuum = true
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question