openpyxl 的导入错误 [英] Import error for openpyxl
问题描述
我对编码非常陌生,在将 openpyxl 导入我的 Python 程序时遇到了问题.我想问题是由于我将它保存在计算机上的位置.
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.
我之前下载过其他库(xlrd、xlwt、xlutils),并将它们保存在我的:C:\Python27\ArcGIS10.1\Lib 或 C:\Python27\ArcGIS10.1\Lib\site-packages, 或 C:\Python27\ArcGISx6410.1\Lib, 或 C:\Python27\ArcGISx6410.1\Lib\site-packages 目录,当我将它们导入脚本时,python 已经能够看到"它们.
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.
我在网络上做了一些拖钓,看起来我可能错误地执行了 openpyxl 的安装".我下载了setuptools-5.7"以尝试运行包含在 openpyxl 库中的 setup.py 脚本,但到目前为止我还没有解决这个问题.
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.
由于我对 python 很陌生,所以我不太了解我一直在寻找的关于如何正确安装库的其他一些东西,例如pip install"等.
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.
如果有人对我如何以最简单的方式安装或保存或定位 openpyxl 库(不使用我没有的其他程序)有任何想法,那就太好了!
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!
推荐答案
您的导入可能不正确.
必须如此.
from openpyxl import workbook
这篇关于openpyxl 的导入错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!