为什么我的Django模块丢失了?

时间:2010-12-09 04:03:12

标签: python django dreamhost

我收到了一个错误:

ImportError at /
No module named lxml
Request Method: GET
Request URL:    http://www.myurl.com/
Django Version: 1.2.1
Exception Type: ImportError
Exception Value:    
No module named lxml
Exception Location: /mypath/project/app/views.py in <module>, line 4
Python Executable:  /usr/bin/python
Python Version: 2.5.2
Python Path:    ['/usr/local/dh/passenger/lib/phusion_passenger/wsgi', '/usr/lib/python2.5', '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-dynload', '/usr/local/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages/Numeric', '/usr/lib/python2.5/site-packages/PIL', '/var/lib/python-support/python2.5', '/usr/lib/site-python', '/home/mysite/mysite.com', '/home/mysite/local/lib/python2.5/site-packages']
Server time:    Wed, 8 Dec 2010 22:59:32 -0500

显然,我改变了路径的名称,但在我的home/mysite/local/lib/python2.5/site-packages folder中,我确实有lxml-2.3beta1-py2.5-linux-x86_64.egg,那么Django怎么找不到呢?

1 个答案:

答案 0 :(得分:3)

因为.egg不在sys.path中。如果您已将其安装到自定义路径,则需要自行添加。