I have a project that I manage to package, distribute, install and import. My package directory looks something like:
/
pkg/
__init__.py
main.py
data/
data_1
data_2.sav
data_3.bin
The problem is that main.py is dependent on non code files inside the data directory, and when I call main.py, I get the following error:
FileNotFoundError: [Errno 2] No such file or directory: 'data/data_1'
Additional:
- all data files are being packaged correctly
in
main.py, the data files are called as:data = pickle.load(open('data/data_1', "rb"))
The main script is not finding the data files for some reason. What can possibly be wrong? Any suggestions?
Thanks!!
print(os.getcwd())