Hi,
We are trying to run uwsgi with multiple python versions and are currently
compiling from source, but have also tried installation via pip. We're on
Ubuntu 10.04 which has Python 2.6 as the default Python version, but need
to run a mix of 2.6 and 2.7 applications that should be managed by the
emperor. The 2.6 application works fine, but the 2.7 application gets an
error when the emperor tries to start the workers. The Python 2.6 and 2.7
plugins were both compiled also.
The init script being used for uwsgi is:
description "uWSGI"
start on runlevel [2345]
stop on runlevel [06]
respawn
exec uwsgi --logto /var/log/uwsgi/emperor.log --emperor /etc/uwsgi/conf.d/
The ini file in question:
[uwsgi]
socket=/tmp/uwsgi.sock
chmod-socket=660
pythonpath=/var/www/deployment
module=wsgi:application
master=True
pidfile=/tmp/deployment-master.pid
uid=uwsgi
gid=fm
harakiri=30
max-requests=5000
post-buffering=4096
logto=/var/log/uwsgi/deployment.log
harakiri-verbose=false
buffer-size=32768
virtualenv=/var/virtualenvs/deployment
plugin=python27
stats=:1717
processes=4
Here is the error:
Python version: 2.6.5 (r265:79063, Oct 1 2012, 22:16:31) [GCC 4.4.3]
Set PythonHome to /var/virtualenvs/deployment
'import site' failed; use -v for traceback
*** Python threads support is disabled. You can enable it with
--enable-threads ***
Python main interpreter initialized at 0xc55c50
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 547800 bytes (534 KB) for 4 cores
*** Operational MODE: preforking ***
added /var/www/deployment/ to pythonpath.
Traceback (most recent call last):
File "/var/www/deployment/wsgi.py", line 2, in <module>
import os
ImportError: No module named os
unable to load app 0 (mountpoint='') (callable not found or import error)
The virtualenv path has the correct python 2.7 binary installed in it, and
has all of the appropriate directory structure that a properly configured
virtualenv requires. Indeed, if the virtualenv is changed to use python
2.6 (also removing the plugin from the ini file), uwsgi serves it up
correctly as well.
--
*
Jon Chappell*
[email protected]
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi