我正在编写一个脚本,它使用日志记录模块来处理脚本的详细程度。我正在使用Eclipse的PyDev插件并运行Python 3.2。如果我"运行"脚本一切正常,但如果我"调试"脚本,我收到以下错误:
Traceback (most recent call last):
File "C:\Program Files (x86)\Eclipse\eclipse\plugins\org.python.pydev_3.2.0.201312292215\pysrc\pydevd.py", line 1146, in trace_dispatch
filename, base = GetFilenameAndBase(frame)
File "C:\Program Files (x86)\Eclipse\eclipse\plugins\org.python.pydev_3.2.0.201312292215\pysrc\pydevd_file_utils.py", line 224, in GetFilenameAndBase
return NORM_FILENAME_AND_BASE_CONTAINER[f]
TypeError: 'NoneType' object is not subscriptable
我无法弄清楚错误的来源,所以我开始评论所有内容并找出声明" import logging"导致错误。这是我正在运行的代码:
import logging
def main():
print("Logging import test")
if __name__ == '__main__':
main()
我已经检查过以确保日志记录模块与我的Python32安装位置中的所有其他标准模块一致。有任何想法吗?同样,这只是在我以调试模式运行PyDev时;运行完成,没有错误。谢谢!