塔架 + mod_wsgi->导入错误:没有名为paste.deploy的模块
我正在遵循此处的示例:http://code.google.com/p/modwsgi /wiki/IntegrationWithPylons
但是,它不起作用 - 我在 apache 错误日志中收到“ImportError: No module named Paste.deploy”。在这种情况下,谷歌搜索没有帮助 - 我看到了一些有关权限的内容,但我的所有权限都很好。 Paste.deploy 到底从哪里来?它来自 site-packages 中的 PasteDeploy-1.3.4-py2.6.egg,安装在我的 pylonsdevenv 目录中,对吧?那么 apache 应该如何知道该目录呢?实际的 pylons 项目是否必须位于 pylonsdevenv 目录中?
谢谢!
I'm following the example here: http://code.google.com/p/modwsgi/wiki/IntegrationWithPylons
however, it doesn't work - I get "ImportError: No module named paste.deploy" in the apache error log. Googling in this case helps not - I see some stuff about permissions, but all my permissions are fine. Where does paste.deploy really come from? It comes from PasteDeploy-1.3.4-py2.6.egg in site-packages, installed in my pylonsdevenv directory, right? Well, then how is apache supposed to know about that directory? Does the actual pylons project have to be in the pylonsdevenv directory?
thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我添加:
到我的 wsgi 文件的顶部,然后在我的development.ini 文件(以及后来的deployment.ini 文件,我猜)中设置 debug = False,这似乎有效...
I added:
to the top of my wsgi file, and then set debug = False in my development.ini file (and later, deployment.ini file, I presume), that seemed to work...
如果您可以手动导入(from Paste.deploy import loadapp),那么它一定是 sys.path 的问题。还要确保 apache 使用正确的 python 解释器。我在 Dreamhost 上的“passanger_wsgi.py”中有类似的内容:
您可以尝试进行一些调试并检查哪些路径位于“sys.path”内。
希望这有帮助。
If you can import (from paste.deploy import loadapp) manually it has to be a problem with sys.path. Also make sure that apache uses proper python interpreter. I have something like this in my "passanger_wsgi.py" on Dreamhost:
You can try put some debug and check which paths are inside "sys.path".
Hope this helps.