使用Pydev 1.5进行调试

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

请给我建议,这个问题的最佳解决方案是什么?或者是我遗漏了什么吗?
提前致谢。
1个回答

5
您缺少django - pydev找不到django模块。
您需要让所有所需的python模块对python可用,通常是通过将环境变量PYTHONPATH包含在模块目录中来实现的。
在pydev中,转到项目->属性->Pydev-PYTHONPATH,选择外部库选项卡。您需要将django包添加到路径中。
或者,正常的Djano install应该已经将django放入python的site-packages中,因此应该在PYTHONPATH上可用。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接