0

My python module "suricate" has three sample datasets stored as csv in it. They are used for testing and for examples. The file structure is like:
~/Projects/suricate/data/companydata
Inside companydata I have the files:

 __init__.py //which is empty    
 left.csv    
 right.csv    
trainingdata.csv  

When I install this module on a virtual env, using pip, I have the following file structure in:

~/anaconda3/envs/myenv/lib/python3.7/sites packages/suricate/data/companydata    

Inside companydata I have the file:
__init__.py
The three csv files are missing

What can I do to make sure the virtualenv copies as well the flat csv files?

Expected: Package in Virtual Env folder has the same flat files as in the local folder

Actual Package in Virtual Env folder has all the *.py files but not the *.csv fles

phd
  • 82,685
  • 13
  • 120
  • 165
Paul Ogier
  • 127
  • 1
  • 7

1 Answers1

0

you need modify setup.py and add the packages and file name in it which you require

setup(...,
  packages=['mypkg'],
  package_dir={'mypkg': 'src/mypkg'},
  package_data={'mypkg': ['data/*.csv']},
  )`

something like this. give relative path to csv file in packages, add packages u required

sahasrara62
  • 10,069
  • 3
  • 29
  • 44