I'm having trouble including data files in my setup.py script. My package is setup as follows:
my_package/
setup.py
MANIFEST.in
my_package/
__init__.py
access_data.py
data_files/
my_data_file.csv
I want to include the my_data_file.csv
file when installing so that it can be read by access_data.py
. To do so I used the package_data
keyword in setuptools
:
setup(...,
packages=['my_package'],
package_data={'my_package': ['./my_package/data_files/my_data_file.csv']},
include_package_data=True
)
I also included the file in MANIFEST.in
:
recursive-include my_package/data_files *
setup.py
seems to run fine and doesn't throw any errors. However, when I import the package I get a file not found error because my_data_file.csv
is missing. I have tried referencing other stack overflow questions (particularly this one) but can't figure out what I'm doing wrong. How can I get setup.py to include the necessary data files?