【发布时间】:2009-10-18 03:46:13
【问题描述】:
我正在通过 DiveIntoPython.com 工作,但在导入工作时遇到了麻烦。我在 windows xp prof 环境中安装了 ActiveState 的 Pythonwin。
网站上有一个练习,涉及到'import odbchelper'和odbchelper。name
http://www.diveintopython.org/getting_to_know_python/testing_modules.html
当我以交互方式运行它时,我得到:
>>> import odbchelper
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
ImportError: No module named odbchelper
>>> odbchelper.__name__
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
NameError: name 'odbchelper' is not defined
我猜要么我没有正确设置路径,要么当我运行“sys.path”时,其中一个文件夹中引用的模块不存在。有什么想法吗?
提前致谢
【问题讨论】: