2015-04-01 31 views
0

我的系統環境時:Windows 8.1, WinPython 3.4.3.1, pandas 0.16, plotly 1.6.14, cufflinks 0.2導入錯誤無模塊名爲「plotlytools」進口袖釦

我不知道是什麼引起的問題。我試圖使用這裏列出的教程cufflinks nbviewer tutorial

但是,當我嘗試導入袖釦模塊時,我得到以下輸出。

enter image description here

這沒有什麼意義,我因爲據我可以告訴這些文件都設置了正確的文件夾中,我沒有看到文件本身內的任何明顯的錯誤。見下圖:

enter image description here

我也看了看__init__.py文件,並沒有看到有什麼異常。

enter image description here

而且最後我看了看實際plotlytools.py文件是否有任何看上去很奇怪,沒有什麼我跳了出來。

enter image description here

任何搞清楚這一個幫助,將不勝感激。謝謝。

更新:如果這有助於在這裏是打印出來的我sys.path

enter image description here

+0

嘗試打開控制檯和'import cufflinks.plotlytools' – user3557327 2015-04-01 21:39:29

+0

爲什麼'lib'在手動檢查的路徑中大寫? – cel 2015-04-02 06:53:58

+0

import cufflinks.plotlytools會產生相同的錯誤。 @cel我不確定爲什麼'Lib'是大寫字母。可能是一個'WinPython'的東西,但它並沒有影響任何其他軟件包的使用。 – BCR 2015-04-02 13:50:20

回答

1

我能夠實現以下解決方法後,導入模塊:

  1. utils.py文件I將()添加到所有print陳述中,例如:print 'string'成爲print('string')
  2. 我複製後刪除了utils.pycolors.py文件,並將內容粘貼到plotlytools.py文件中。
  3. 我更新了其餘文件中的所有導入引用。
  4. 使用pandastools函數,特別是df.iplot方法,但也有必要更新爲從str.encode('hex') and str.decode('hex')colors.py文件中的編碼和解碼方法,以import codecs; codecs.encode(str,'hex'); codecs.decode(str,'hex')
  5. 我也更新從gen_object.next()發電機方法next(gen_object)

此時模塊的所有功能似乎都已恢復。

相關問題