2013-08-27 2 views
2

전 세계적으로 uWSGI가 설치되어 있고 장고와 함께 Python 3.3의 virtualenv로 실행 중입니다. 하지만 이제는 Python 2.7을 사용하여 uWSGI의 다른 인스턴스를 실행하려고합니다. 나는 파이썬 2.7의 virtualenv에서 홈을위한 옵션을 설정했다. 그러나 파이썬 버전은 여전히 ​​3.3 버전이다.uWSGI django와 함께 Python2를 실행합니다

# Django-related settings 
# the base directory (full path) 
chdir   = /home/srvadmin/webapps2.7/project 
# Django's wsgi file 
module   = project.wsgi 
# the virtualenv (full path) 
home   = /home/srvadmin/py2.7 

# process-related settings 
# master 
master   = true 
# maximum number of worker processes 
processes  = 10 
# the socket (use the full path to be safe 
socket   = /tmp/mysite2.7.sock 
# ... with appropriate permissions - may be needed 
chmod-socket = 666 
# clear environment on exit 
vacuum   = true 

을하지만 난 항상이

uWSGI http bound on 0.0.0.0:1234 fd 4 
spawned uWSGI http 1 (pid: 31507) 
uwsgi socket 0 bound to TCP address 127.0.0.1:33896 (port auto-assigned) fd 3 
Python version: 3.3.2 (default, May 16 2013, 18:35:00) [GCC 4.6.3] 
Set PythonHome to /home/srvadmin/py2.7/ 
Fatal Python error: Py_Initialize: Unable to get the locale encoding 
ImportError: No module named 'encodings' 
Aborted 

답변

2

귀하의 uWSGI 바이너리가 특정 libpython (3.3 일)와 연결되어 얻을 :

은 현재 내가 uWSGI이 설정이 있습니다. 당신은 python2.7에 대한 uWSGI의 두 번째 복사본을 만들거나 모듈 빌드 사용할 수 있습니다

(에서 소스 디렉토리)

python3 uwsgiconfig.py --build nolang

python3의 uwsgiconfig.py을 - 플러그인 플러그인/파이썬 nolang python33

python2 uwsgiconfig.py --plugin 플러그인/파이썬 nolang python27

당신이 종료됩니다

는 'uwsgi'바이너리와 'python33_plugin.so'와 'python27_plugin.so'

+0

그래서 소스에서 컴파일해야합니까? 이것은 시스템 차원의 uwsgi 권한에 영향을주지 않을까요? 답변 해주셔서 감사합니다. :) –

+0

결과 바이너리 및 플러그인이 소스 디렉토리에 빌드되지 않습니다. – roberto

관련 문제