我尝试安装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'
我在Python 3.4和3.3中遇到同样的问题,我该如何解决呢?
答案 0 :(得分:8)
答案 1 :(得分:0)
jdcal
是openpyxl所需的库,但应自动安装。你是如何安装openpyxl的?
答案 2 :(得分:0)
我设法通过卸载 openpyxl , jdcall 和 et-xmlfile 来启动 openpyxl ,然后重新安装这三个,然后升级所有三个。
不确定原因是什么,错误消息仍然存在,但我能够成功导入 openpyxl 并创建工作簿。
答案 3 :(得分:0)
从https://pypi.org/project/jdcal/#files下载jdcal-xxxtar.gz并将其解压缩到\ path \ to \ pythonxx \ Lib \ site-packages \后,我不得不从\ path \ to复制jdcal.py文件。 \ pythonxx \ Lib \ site-packages \ jdcal-1.4.1 \到\ path \ to \ pythonxx \ Lib \ site-packages \才能正常工作。