我正在通过DiveIntoPython.com完成我的工作,而且我很难让这个导入开始工作。我已经在windows环境中安装了ActiveState的Pythonwin。
在网站中,有一项涉及“导入”和“odbchelper.name”的练习。
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‘时,要么我没有正确设置粘贴设置,要么当我运行’sys.path‘时,其中一个文件夹中没有引用模块。有什么想法吗?
提前感谢
发布于 2009-10-18 03:50:02
这个模块不一定附带Python2.6 (刚刚在我的机器上试用过)。你试过谷歌这个模块可能在哪里吗?
考虑一下这个帖子。
发布于 2009-10-18 03:55:25
弄明白了..。
发现这个:
http://www.faqs.org/docs/diveintopython/odbchelper_divein.html下载了该文件,然后将其放入文件夹。c:\temp\python\在我的例子中使用命令:
>> import sys
>> sys.path.append('c:\\temp\\python\\')https://stackoverflow.com/questions/1583947
复制相似问题