importing xlwings module into python 3.4

房东的猫 提交于 2019-12-04 03:51:49

问题


I'm trying to use the new excel integration module xlwings It works like a charm under Anaconda 2.0 for python 2.7 but I'm getting this error under Anaconda 2.0 for python 3.4 the xlwings file does contain class Workbook so I don't understand why it can't import it when I simply use the xlwings file in my project for 3.4 it works just fine

File "C:\Users\xxxxx\AppData\Local\Continuum\Anaconda3\lib\site-packages\xlwings__init__.py", line 1, in from xlwings import Workbook, Range, Chart, version

ImportError: cannot import name 'Workbook'


回答1:


In "C:\Users\xxxxx\AppData\Local\Continuum\Anaconda3\lib\site-packages\xlwings__init__.py"

Try changing from xlwings import Workbook, Range, Chart, __version__

to from xlwings.xlwings import Workbook, Range, Chart, __version__



来源:https://stackoverflow.com/questions/24121692/importing-xlwings-module-into-python-3-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!