Python Openpyxl 缺少“jdcal”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25360450/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-18 20:06:45  来源:igfitidea点击:

Openpyxl missing 'jdcal'

pythonopenpyxl

提问by Midas

I tried to install the openpyxlmodule, but during the installation it showed some errors with JDcall. When I then try to import it, I get this error:

我尝试安装该openpyxl模块,但在安装过程中它显示了一些错误JDcall。当我然后尝试导入它时,我收到此错误:

 Traceback (most recent call last):
  File "C:\Andrzej\workspace\sandbox\sandbox.py", line 7, in <module>
    import openpyxl 

  File "C:\Python34\lib\site-packages\openpyxl-2.0.5-py3.4.egg\openpyxl\__init__.py", line 29, in <module>
    from openpyxl.workbook import Workbook

  File "C:\Python34\lib\site-packages\openpyxl-2.0.5-py3.4.egg\openpyxl\workbook\__init__.py", line 25, in <module>
    from .workbook import *

  File "C:\Python34\lib\site-packages\openpyxl-2.0.5-py3.4.egg\openpyxl\workbook\workbook.py", line 35, in <module>
    from openpyxl.worksheet import Worksheet

  File "C:\Python34\lib\site-packages\openpyxl-2.0.5-py3.4.egg\openpyxl\worksheet\__init__.py", line 25, in <module>
    from .worksheet import *

  File "C:\Python34\lib\site-packages\openpyxl-2.0.5-py3.4.egg\openpyxl\worksheet\worksheet.py", line 35, in <module>
    import openpyxl.cell

  File "C:\Python34\lib\site-packages\openpyxl-2.0.5-py3.4.egg\openpyxl\cell\__init__.py", line 25, in <module>
    from .cell import *

  File "C:\Python34\lib\site-packages\openpyxl-2.0.5-py3.4.egg\openpyxl\cell\cell.py", line 47, in <module>
    from openpyxl.date_time import (

  File "C:\Python34\lib\site-packages\openpyxl-2.0.5-py3.4.egg\openpyxl\date_time.py", line 34, in <module>
    from jdcal import (

ImportError: No module named 'jdcal'

I get this same problem for Python 3.4 and 3.3, how can I solve it?

我在 Python 3.4 和 3.3 上遇到了同样的问题,我该如何解决?

采纳答案by bibinjose

You should install jdcalseparately. After this, install Openpyxl. I faced the same issue - after doing this, it got resolved

您应该单独安装jdcal。在此之后,安装Openpyxl。我遇到了同样的问题 - 这样做后,它得到了解决

回答by Charlie Clark

jdcalis a library required by openpyxl but should be installed automatically. How are you installing openpyxl?

jdcal是 openpyxl 所需的库,但应自动安装。你是如何安装openpyxl的?

回答by user3377603

I managed to get openpyxlto work by uninstalling openpyxl, jdcalland et-xmlfile, then reinstalling all three, then upgrading all three.

我设法通过卸载openpyxljdcallet-xmlfile,然后重新安装所有三个,然后升级所有三个来使openpyxl工作。

Not sure why it works, and the error messages are still there, but I was able to successfully import openpyxland create a workbook.

不知道为什么它有效,错误消息仍然存在,但我能够成功导入openpyxl并创建一个工作簿。

回答by Konstantinos

After I downloaded the jdcal-x.x.x.tar.gz from https://pypi.org/project/jdcal/#filesand extracted it in \path\to\pythonxx\Lib\site-packages\ I had to copy the jdcal.py file from \path\to\pythonxx\Lib\site-packages\jdcal-1.4.1\ to \path\to\pythonxx\Lib\site-packages\ in order to work.

https://pypi.org/project/jdcal/#files下载 jdcal-xxxtar.gz并将其解压缩到 \path\to\pythonxx\Lib\site-packages\ 后,我不得不复制 jdcal.py 文件从 \path\to\pythonxx\Lib\site-packages\jdcal-1.4.1\ 到 \path\to\pythonxx\Lib\site-packages\ 以便工作。