openpyxl的导入错误

openpyxl的导入错误

本文介绍了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!

推荐答案

您的导入可能不正确.

Your import is probably incorrect.

它必须是.

from openpyxl import workbook

这篇关于openpyxl的导入错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 11:49