Discussion:
[uWSGI] ImportError: No module named site while starting the uwsgi
Manivel Rajendran
2018-04-10 07:00:35 UTC
Permalink
Hi,

I have created a new django project and try to run that project using
uwsgi. It is giving the error "i.e *ImportError: No module named site*"
Here i have installed the uwsgi 2.0.15 on virtual environment.

I started the uwsgi using below command

# uwsgi --ini project.ini



*Error log**** Starting uWSGI 2.0.15 (64bit) on [12:18:54 2018] ***
compiled with version: 4.4.7 20120313 (Red Hat 4.4.7-18) on 10 April 2018
11:38:04
os: Linux #1 SMP Tue Aug 22 18:51:35 UTC 2017
nodename: test-machine
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 12
current working directory: /test_project/project1
writing pidfile to /test_project/project1/uwsgi-master.pid
detected binary path: /test_project/virtualenv/bin/uwsgi
chdir() to /test_project/project1
your processes number limit is 255301
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 /var/run/uwsgi/uwsgi.sock fd 3
setgid() to 48
setuid() to 48
Python version: 2.7.6 (default, Jan 24 2015, 23:12:37) [GCC 4.4.7 20120313
(Red Hat 4.4.7-11)]
Set PythonHome to /test_project/virtualenv
ImportError: No module named site

*My uwsgi.ini configuration*

[uwsgi]
chdir= /test_project/project1
module=forums.wsgi:application
virtualenv= /test_project/virtualenv
socket=/var/run/uwsgi/uwsgi.sock
uid=apache
gid=apache
chmod-socket=664
chown-socket=apache:apache
master=True
workers=2
pidfile=/test_project/project1/uwsgi-master.pid
max-requests=2000
daemonize=/var/log/uwsgi/project1.log
log-date=%%a %%b %%d %%H:%%M:%%S

How to resolve this issue?

Thanks
Manivel R
Etienne Robillard
2018-04-10 08:37:03 UTC
Permalink
Hi Manivel,

Can you try without virtualenv using uWSGI 2.0.17 ?

Thanks,

Etienne
Post by Manivel Rajendran
Hi,
I have created a new django project and try to run that project using
uwsgi. It is giving the error "i.e *ImportError: No module named site*"
Here i have installed the uwsgi 2.0.15 on virtual environment.
I started the uwsgi using below command
# uwsgi --ini project.ini
*Error log
**** Starting uWSGI 2.0.15 (64bit) on [12:18:54 2018] ***
compiled with version: 4.4.7 20120313 (Red Hat 4.4.7-18) on 10 April
2018 11:38:04
os: Linux #1 SMP Tue Aug 22 18:51:35 UTC 2017
nodename: test-machine
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 12
current working directory: /test_project/project1
writing pidfile to /test_project/project1/uwsgi-master.pid
detected binary path: /test_project/virtualenv/bin/uwsgi
chdir() to /test_project/project1
your processes number limit is 255301
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 /var/run/uwsgi/uwsgi.sock fd 3
setgid() to 48
setuid() to 48
Python version: 2.7.6 (default, Jan 24 2015, 23:12:37)  [GCC 4.4.7
20120313 (Red Hat 4.4.7-11)]
Set PythonHome to /test_project/virtualenv
ImportError: No module named site
*My uwsgi.ini configuration*
[uwsgi]
chdir= /test_project/project1
module=forums.wsgi:application
virtualenv= /test_project/virtualenv
socket=/var/run/uwsgi/uwsgi.sock
uid=apache
gid=apache
chmod-socket=664
chown-socket=apache:apache
master=True
workers=2
pidfile=/test_project/project1/uwsgi-master.pid
max-requests=2000
daemonize=/var/log/uwsgi/project1.log
log-date=%%a %%b %%d %%H:%%M:%%S
How to resolve this issue?
Thanks
Manivel R
_______________________________________________
uWSGI mailing list
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
--
Etienne Robillard
***@yandex.com
https://www.isotopesoftware.ca/
Manivel Rajendran
2018-04-10 10:25:31 UTC
Permalink
Hi Etienne,

I have tried without virtualenv in uWSGI 2.0.17. It is started.
But While accessing the URL in browser, it is giving the "Internal server
error"

*uWSGI log error :*
no python application found, check your startup logs for errors.


Thanks,
Manivel R
Post by Etienne Robillard
Hi Manivel,
Can you try without virtualenv using uWSGI 2.0.17 ?
Thanks,
Etienne
Hi,
I have created a new django project and try to run that project using
uwsgi. It is giving the error "i.e *ImportError: No module named site*"
Here i have installed the uwsgi 2.0.15 on virtual environment.
I started the uwsgi using below command
# uwsgi --ini project.ini
*Error log **** Starting uWSGI 2.0.15 (64bit) on [12:18:54 2018] ***
compiled with version: 4.4.7 20120313 (Red Hat 4.4.7-18) on 10 April 2018
11:38:04
os: Linux #1 SMP Tue Aug 22 18:51:35 UTC 2017
nodename: test-machine
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 12
current working directory: /test_project/project1
writing pidfile to /test_project/project1/uwsgi-master.pid
detected binary path: /test_project/virtualenv/bin/uwsgi
chdir() to /test_project/project1
your processes number limit is 255301
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 /var/run/uwsgi/uwsgi.sock fd 3
setgid() to 48
setuid() to 48
Python version: 2.7.6 (default, Jan 24 2015, 23:12:37) [GCC 4.4.7
20120313 (Red Hat 4.4.7-11)]
Set PythonHome to /test_project/virtualenv
ImportError: No module named site
*My uwsgi.ini configuration*
[uwsgi]
chdir= /test_project/project1
module=forums.wsgi:application
virtualenv= /test_project/virtualenv
socket=/var/run/uwsgi/uwsgi.sock
uid=apache
gid=apache
chmod-socket=664
chown-socket=apache:apache
master=True
workers=2
pidfile=/test_project/project1/uwsgi-master.pid
max-requests=2000
daemonize=/var/log/uwsgi/project1.log
log-date=%%a %%b %%d %%H:%%M:%%S
How to resolve this issue?
Thanks
Manivel R
_______________________________________________
--
--
*Best RegardsManivel Rajendran*
Paul J Stevens
2018-04-10 12:57:32 UTC
Permalink
Post by Manivel Rajendran
Hi Etienne,
I have tried without virtualenv in uWSGI 2.0.17. It is started.
But While accessing the URL in browser, it is giving the "Internal
server error"
*uWSGI log error :*
 no python application found, check your startup logs for errors.
without looking at your settings: check that ALLOWED_HOSTS is correct.
You may need to empty it to verify that it's the culprit.
Post by Manivel Rajendran
Thanks,
Manivel R
Hi Manivel,
Can you try without virtualenv using uWSGI 2.0.17 ?
Thanks,
Etienne
Post by Manivel Rajendran
Hi,
I have created a new django project and try to run that project
using uwsgi. It is giving the error "i.e *ImportError: No module
named site*"
Here i have installed the uwsgi 2.0.15 on virtual environment.
I started the uwsgi using below command
# uwsgi --ini project.ini
*Error log
**** Starting uWSGI 2.0.15 (64bit) on [12:18:54 2018] ***
compiled with version: 4.4.7 20120313 (Red Hat 4.4.7-18) on 10
April 2018 11:38:04
os: Linux #1 SMP Tue Aug 22 18:51:35 UTC 2017
nodename: test-machine
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 12
current working directory: /test_project/project1
writing pidfile to /test_project/project1/uwsgi-master.pid
detected binary path: /test_project/virtualenv/bin/uwsgi
chdir() to /test_project/project1
your processes number limit is 255301
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 /var/run/uwsgi/uwsgi.sock fd 3
setgid() to 48
setuid() to 48
Python version: 2.7.6 (default, Jan 24 2015, 23:12:37)  [GCC 4.4.7
20120313 (Red Hat 4.4.7-11)]
Set PythonHome to /test_project/virtualenv
ImportError: No module named site
 
*My uwsgi.ini configuration*
[uwsgi]
chdir= /test_project/project1
module=forums.wsgi:application
virtualenv= /test_project/virtualenv
socket=/var/run/uwsgi/uwsgi.sock
uid=apache
gid=apache
chmod-socket=664
chown-socket=apache:apache
master=True
workers=2
pidfile=/test_project/project1/uwsgi-master.pid
max-requests=2000
daemonize=/var/log/uwsgi/project1.log
log-date=%%a %%b %%d %%H:%%M:%%S
How to resolve this issue?
Thanks
Manivel R
_______________________________________________
uWSGI mailing list
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
<http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi>
--
Etienne Robillard
https://www.isotopesoftware.ca/ <https://www.isotopesoftware.ca/>
--
*Best Regards
Manivel Rajendran*
_______________________________________________
uWSGI mailing list
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
--
Lab Digital
Paul J Stevens | Systems Engineering
M: +31 (0)62 460 6876
T: +31 (0)85 060 3980
Kanaalweg 14-G, 3526 KL Utrecht
Loading...