Import error for openpyxl

假如想象 提交于 2019-12-25 07:11:05

问题


I'm very very new to coding and I'm having an issue importing openpyxl into my python program. I imagine the issue is due to where I have it saved on my computer.

I've downloaded other libraries (xlrd, xlwt, xlutils) before and just saved them in my: C:\Python27\ArcGIS10.1\Lib, or C:\Python27\ArcGIS10.1\Lib\site-packages, or C:\Python27\ArcGISx6410.1\Lib, or C:\Python27\ArcGISx6410.1\Lib\site-packages directories and python has been able to "see" them when i import them into a script.

I've done some trolling on the web and it looks like I may be performing the "installation" of openpyxl incorrectly. I downloaded "setuptools-5.7" in order to try to run the setup.py script contained within the openpyxl library, and so far I haven't gotten that to work out.

Since I'm so new to python, I don't really understand some of the other stuff I've been finding about how to correctly install the library, like "pip install" etc.

If anyone has any ideas about how I can install or save or locate the openpyxl library in the easiest fashion (without using other programs that I don't already have), that would be great!


回答1:


Your import is probably incorrect.

It needs to be.

from openpyxl import workbook


来源:https://stackoverflow.com/questions/25665529/import-error-for-openpyxl

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