1

I am testing a python package that contains a .ods file where you can enter some information and then the rest of the python package pull the information out manipulates it and provides an output. On my local computer the follow code works fine. Once testing in a virtual enviroment I am having problems getting the error KeyError: '.ods'

I dont think importlib will work here for this file type. Has anyone used .ods file in a package?

My code:

from pandas_ods_reader import read_ods
path = "librebook.ods"
df = read_ods(path)

Package: mypackage 
├── src
│   ├── mypackage 
│       └── librebook.ods
|       └── __init__.py
|-setup.py
|-readme.md
Stackaccount1
  • 139
  • 1
  • 12
  • 1
    I got this error when passing a non-existing file. Quite un-helpful ... (there is a message for non-existing files!). In your case it could be that you need to pass a more complete path for the file, if your current working directory is not "mypackage". – rpicatoste Oct 25 '21 at 07:05

0 Answers0