2015-04-01 79 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)

此时模块的所有功能似乎都已恢复。

相关问题