我在django中看到两个不同的python路径。
这个出现在开发服务器上(即python manage.py runserver等):
['/var/www/html/django/congressticketing',
'/usr/lib/python2.4/site-packages/MySQL_python-1.2.3c1-py2.4-linux-i686.egg', '/usr/lib/python2.4/site-packages/pisa-3.0.32-py2.4.egg',
'/usr/lib/python2.4/site-packages/Whoosh-0.3.9-py2.4.egg',
'/usr/lib/python2.4/site-packages/html5lib-0.11-py2.4.egg',
'/usr/lib/python2.4/site-packages/multiprocessing-2.6.2.1-py2.4-linux-i686.egg','/usr/lib/python2.4/site-packages/anyjson-0.2.4-py2.4.egg',
'/usr/lib/python2.4/site-packages/SQLAlchemy-0.6.0-py2.4.egg',
'/usr/lib/python2.4/site-packages/mailer-0.5-py2.4.egg',
'/usr/lib/python2.4/site-packages/python_dateutil-1.5-py2.4.egg',
'/usr/lib/python2.4/site-packages/simplejson-2.1.1-py2.4-linux-i686.egg', '/usr/lib/python2.4/site-packages/dottedish-0.6-py2.4.egg',
'/usr/lib/python2.4/site-packages/simplegeneric-0.6-py2.4.egg',
'/usr/lib/python2.4/site-packages/supervisor-3.0a8-py2.4.egg',
'/usr/lib/python2.4/site-packages/elementtree-1.2.7_20070827_preview-py2.4.egg', '/usr/lib/python2.4/site-packages/meld3-0.6.6-py2.4.egg',
'/usr/lib/python2.4/site-packages/billiard-0.3.1-py2.4.egg',
'/usr/lib/python2.4/site-packages/pycrypto-2.2-py2.4-linux-i686.egg', '/usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg',
'/usr/lib/python2.4/site-packages/Genshi-0.6-py2.4.egg',
'/usr/lib/python2.4/site-packages/django_thumbnail_works-0.2.0-py2.4.egg', '/usr/lib/python2.4/site-packages/cropresize-0.1.4-py2.4.egg',
'/usr/lib/python2.4/site-packages/uuid-1.30-py2.4.egg',
'/usr/lib/python2.4/site-packages/pyparsing-1.5.5-py2.4.egg',
'/usr/lib/python2.4/site-packages/carrot-0.10.7-py2.4.egg',
'/usr/lib/python2.4/site-packages/django_compress-1.0.1-py2.4.egg', '/usr/lib/python2.4/site-packages/BeautifulSoup-3.2.0-py2.4.egg',
'/usr/lib/python2.4/site-packages/lxml-2.3beta1-py2.4-linux-i686.egg', '/usr/lib/python2.4/site-packages/django_celery-2.1.4-py2.4.egg',
'/usr/lib/python2.4/site-packages/sorl_thumbnail-10.12-py2.4.egg', '/usr/lib/python2.4/site-packages',
'/usr/lib/python24.zip',
'/usr/lib/python2.4',
'/usr/lib/python2.4/plat-linux2',
'/usr/lib/python2.4/lib-tk',
'/usr/lib/python2.4/lib-dynload',
'/usr/lib/python2.4/site-packages/Numeric',
'/usr/lib/python2.4/site-packages/PIL',
'/usr/lib/python2.4/site-packages/gtk-2.0']
这个 - 更短 - 显示在生产中(使用mod_python):
['/var/www/html/django/congressticketing',
'/usr/lib/python2.4/site-packages/MySQL_python-1.2.3c1-py2.4-linux-i686.egg', '/usr/lib/python2.4/site-packages/pisa-3.0.32-py2.4.egg',
'/usr/lib/python2.4/site-packages/Whoosh-0.3.9-py2.4.egg',
'/usr/lib/python2.4/site-packages/html5lib-0.11-py2.4.egg',
'/usr/lib/python2.4/site-packages/multiprocessing-2.6.2.1-py2.4-linux-i686.egg', '/usr/lib/python2.4/site-packages/anyjson-0.2.4-py2.4.egg',
'/usr/lib/python2.4/site-packages/SQLAlchemy-0.6.0-py2.4.egg',
'/usr/lib/python2.4/site-packages/python_dateutil-1.5-py2.4.egg',
'/usr/lib/python2.4/site-packages/simplejson-2.1.1-py2.4-linux-i686.egg', '/usr/lib/python2.4/site-packages/dottedish-0.6-py2.4.egg',
'/usr/lib/python2.4/site-packages/supervisor-3.0a8-py2.4.egg',
'/usr/lib/python2.4/site-packages/billiard-0.3.1-py2.4.egg',
'/usr/lib/python2.4/site-packages/Trac-0.12-py2.4.egg',
'/usr/lib/python2.4/site-packages/django_thumbnail_works-0.2.0-py2.4.egg', '/usr/lib/python2.4/site-packages/cropresize-0.1.4-py2.4.egg',
'/usr/lib/python2.4/site-packages/pyparsing-1.5.5-py2.4.egg',
'/usr/lib/python2.4/site-packages/carrot-0.10.7-py2.4.egg',
'/usr/lib/python2.4/site-packages/BeautifulSoup-3.2.0-py2.4.egg',
'/usr/lib/python2.4/site-packages/lxml-2.3beta1-py2.4-linux-i686.egg', '/usr/lib/python2.4/site-packages/django_celery-2.1.4-py2.4.egg',
'/usr/lib/python2.4/site-packages/sorl_thumbnail-10.12-py2.4.egg', '/usr/lib/python2.4/site-packages',
'/usr/lib/python24.zip',
'/usr/lib/python2.4',
'/usr/lib/python2.4/plat-linux2',
'/usr/lib/python2.4/lib-tk',
'/usr/lib/python2.4/lib-dynload',
'/usr/lib/python2.4/site-packages/Numeric',
'/usr/lib/python2.4/site-packages/PIL',
'/usr/lib/python2.4/site-packages/gtk-2.0']
有谁知道为什么会这样?
答案 0 :(得分:1)
这可能是权限问题。检查缺少的站点包的文件和目录权限。可能是mod_python
或Apache
正在运行的用户名无法访问这些文件。