2009-10-18 61 views
1

我正在通過DiveIntoPython.com工作,並且無法使導入工作。我已經在windows xp prof環境中安裝了ActiveState的Pythonwin。activestate pythonwin缺少導入模塊?

在網站上,有一個練習涉及'導入odbchelper'和odbchelper。

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」。有任何想法嗎?

在此先感謝

回答

1

此模塊不來包裝與python2.6的肯定(只是試圖在我的機器上)。你有沒有嘗試在這個模塊的地方使用谷歌搜索?

考慮這個post

+0

是啊我找到了類似的東西..你打敗了我。 – phill 2009-10-18 03:56:39

1

想通了..

發現這一點:

http://www.faqs.org/docs/diveintopython/odbchelper_divein.html 

下載的文件,然後將其放到一個文件夾中。 c:\ temp \ python \在我的情況下與命令:

>> import sys 
>> sys.path.append('c:\\temp\\python\\') 
+0

我認爲這是一個內置的,但你說得對,它自帶潛入Python本身 – 2011-03-10 09:53:44