distutils data file difficulties

Brian L. Troutwine goofyheadedpunk at gmail.com
Thu Jan 18 16:09:59 EST 2007


I am new to the use of distutils and am having difficulty getting
distutils recognize and install data files. Here are the relevant parts
of my source directory:

ExampleTree/
|-- __init__.py
|-- data
|   |-- Example1.txt
|   |-- Example2.txt
|   `-- __init__.py
|-- subPackage1
|   |-- (...)
`-- subPackage2
    |-- (...)

I would like to install Example1.txt and Example2.txt under data/ upon
installation. I cannot seem to write a proper setup.py to accomplish
this. Here are the relevant bits of my setup.py:

#!/usr/bin/env python

from distutils.core import setup

setup(name="ExampleTree",
        (...),
        packages=['ExampleTree', ExampleTree/data',
'ExampleTree/subPackage1',
            ''ExampleTree/subPackage2'],
        package_dir={'data' : 'ExampleTree/data'},
        package_data={'data': ['Example1.txt', 'Example2.txt']},
        )

What am I doing incorrectly?




More information about the Python-list mailing list