我已經使用mod_wsgi部署了一個Pyramid應用程序。wsgi應用程序使用較舊的Python版本
我已經安裝在虛擬主機Python路徑:
WSGIDaemonProcess MyApp user=myUser group=staff threads=4 python-path=/home/myapp/env/lib/python2.7/site-packages
WSGIScriptAlias//home/myapp/env/pyramid.wsgi
進行調試,在pyramid.wsgi,我也提出:
import sys
print(sys.path)
print(sys.version)
當我訪問應用程序,我可以看到該應用程序使用python 2.6而不是2.7!
的sys.path的輸出這樣的:
['/home/myapp/env/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg',
'/home/myapp/env/lib/python2.7/site-packages/pip-1.0.1-py2.7.egg',
'/home/myapp/env/lib/python2.7/site-packages',
'/home/myapp/env/lib/python2.7/site-packages/PIL',
'/opt/local/lib/python2.6/site-packages/setuptools-0.6c12dev_r88846-py2.6.egg',
'/opt/local/lib/python2.6/site-packages/virtualenv-1.6.1-py2.6.egg',
'/opt/local/lib/python26.zip',
'/opt/local/lib/python2.6',
'/opt/local/lib/python2.6/plat-sunos5',
'/opt/local/lib/python2.6/lib-tk',
'/opt/local/lib/python2.6/lib-old',
'/opt/local/lib/python2.6/lib-dynload',
'/opt/local/lib/python2.6/site-packages']
你可以看到蟒蛇2.6路徑是存在的,但如果我ssh到服務器並執行Python它啓動python2.7。
2.6哪裏來的?哪個用戶(apache?)正在調用這個wsgi應用程序,以便我可以更改它的python環境?
請幫忙!