Openpyxl library - jdcal error

I am trying to work on some excel files, I decided to use the openpyxl library. I copied the openpyxl folder to / lib / and tried to execute the import command on some sample code, and all I get is a list of several errors.

Traceback (most recent call last): File "C:/Users/Karolina/Documents/python/test xlsx.py", line 1, in <module> import openpyxl File "C:\Python34\lib\openpyxl\__init__.py", line 9, in <module> from openpyxl.workbook import Workbook File "C:\Python34\lib\openpyxl\workbook\__init__.py", line 5, in <module> from .workbook import * File "C:\Python34\lib\openpyxl\workbook\workbook.py", line 14, in <module> from openpyxl.utils.datetime import CALENDAR_WINDOWS_1900 File "C:\Python34\lib\openpyxl\utils\datetime.py", line 11, in <module> from jdcal import ( ImportError: cannot import name 'gcal2jd' 

At first I got the same error about "jdcal", so I installed the jdcal library. Now I don’t know how to fix it, what’s wrong with him? I am using python 3.4

+5
source share
3 answers

In fact, openpyxl depends on jdcal and et_xmlfile . First you need to install these two packages. I managed to run openpyxl by downloading and markup something like this:

 #For Writing in Excel File import sys #For openpyxl-2.4.0 Python Package you should need to have et_xmlfile and jdcal package sys.path.append("D:\et_xmlfile-1.0.1") sys.path.append("D:\jdcal-1.3") sys.path.append('D:\openpyxl-2.4.0') import openpyxl 
+1
source

The openpyxl module has 2 dependent modules: 1. jdcal 2. et_xmlfile

I managed to install the openpyxl module, and here is what I did:

  • We downloaded the file openpyxl, jdcal and et_xml from https://pypi.python.org/pypi and saved jdcal-1.0.tar.gz, et_xmlfile-1.0.0.tar.gz, openpyxl-2.3.0-b2.tar.gz in a local folder on my system.

  • Then I executed the commands in the following order:

     pip install jdcal-1.0.tar.gz pip install et_xmlfile-1.0.0.tar.gz pip install openpyxl-2.3.0-b2.tar.gz 

openpyxl succeeds after that.

0
source

I was the same problem. I solved it :). if you have pip3 or another, you can just download and install from your terminal: -

 sudo pip3 pip3 install jdcal sudo pip3 install et_xmlfile 
0
source

All Articles