14

I can't figure out why when I run pip install ../path_to_my_proj/ (from a virtualenv) none of the data files are copied across to the sitepackage/myproj/ folder. The python packages are copied across correctly.

python version 3.4.4

My project directory is like this:

├── myproj
│   ├── __init__.py
│   ├── module1.py
│   └── module2.py
├── data_files
|    ├── subfolder1
│    |   ├── datafile.dll
│    |   └── datafile2.dll
|    └── subfolder2
│        ├── datafile3.dll
│        └── datafile4.dll
|
├── MANIFEST.in
└── setup.py

And my MANIFEST.in looks like

recursive-include data_files *
include README.md

my setup looks like:

setup(
    name='myproj',
    version='0.1.1',
    install_requires=['requirement'],
    packages=['myproj'],
    include_package_data=True,
)  
Luke McAuley
  • 151
  • 1
  • 5
  • 1
    take a look at https://stackoverflow.com/questions/13307408/python-packaging-data-files-are-put-properly-in-tar-gz-file-but-are-not-install? – axd Oct 10 '17 at 11:37

1 Answers1

20

I encountered the same problem and asked about it on https://gitter.im/pypa/setuptools. The result? You just can't do that. data_files must live under myproj.

You can fake it by putting an empty __init__.py in data_files, but then it will get put into PYTHONHOME\Lib\site-packages along side myproj at same level, polluting the name space.

matt wilkie
  • 17,268
  • 24
  • 80
  • 115