distutils won't add data file to package dir

Lee Harr missive at frontiernet.net
Sat Jun 21 16:28:17 EDT 2003


In article <mailman.1056224323.16059.python-list at python.org>, Michael Mell:
> according to the thread at
> http://mail.python.org/pipermail/distutils-sig/2000-May/001093.html
> it is advised to put static data files in the package directory of a  
> Python application.
> 
> distutils seems to refuse to do this unless the file has a .py  
> extension.
> My data file, appropriately, has a .txt extension. It is listed in the  
> MANIFEST.
> 
> > python setup.py install
> simply ignores the data file.
> 
> Here is my setup.py
> + + + + + + + +
> from distutils.core import setup
> 
> setup (name="Elements",
> 	author="Mike Mell",
> 	author_email="mike at nthwave.net",
> 	url="http://www.nthwave.net/elements/",
> 	version="1.1.1",
> 	packages=['Elements']
> 	)
> + + + + + + + +
> I've tried several variations on this.
> 
> The data_files option is not appropriate here. As the docs say [1],  
> using the data_files option places the data file in sys.prefix -- which  
> is definitely not site-packages/Elements.
> 
> What am I doing wrong?
> 


I recommend looking at another program that does what you want yours
to do...

I use a thing that Pygame uses to put data in the package directory.
Works fine, but I think finding the right place for data and putting
it there is still a distutils weak point.






More information about the Python-list mailing list