5

我正在尝试使用 Pydev 1.5 调试我的应用程序

我已经完成了文档中提到的几乎所有内容来启动调试器。

当我尝试开始调试时出现此错误:

pydev debugger: warning: psyco not available for speedups (the debugger will still work correctly, but a bit slower)
pydev debugger: starting
Traceback (most recent call last):
  File "C:\Documents and Settings\mkallat\Desktop\eclipse\plugins\org.python.pydev.debug_1.5.0.1251989166\pysrc\pydevd.py", line 953, in <module>
    debugger.run(setup['file'], None, None)
  File "C:\Documents and Settings\mkallat\Desktop\eclipse\plugins\org.python.pydev.debug_1.5.0.1251989166\pysrc\pydevd.py", line 780, in run
    execfile(file, globals, locals) #execute the script
  File "Z:\dev\hfholidays\urls.py", line 1, in <module>
    from django.conf.urls.defaults import *
ImportError: No module named django.conf.urls.defaults

请建议我对此的最佳解决方案是什么。还是我错过了什么?

提前致谢。

4

1 回答 1

5

您缺少 django - pydev 找不到 django 模块

您需要让 python 可以访问所有需要的 python 模块,这通常通过让环境变量 PYTHONPATH 包含模块的目录来完成。

在 pydev 中,转到 project->Properties->Pydev-PYTHONPATH 选择 External libraries 选项卡。您需要将 django 包添加到您的路径中。

或者,正常的Djano 安装 应该将 django 放入 python 的站点包中,因此应该在 PYTHONPATH 上可用

于 2009-10-01T11:03:00.487 回答