proper way to add data dir in buit distribution

Auré Gourrier aurelien.gourrier at
Tue Oct 19 21:10:37 CEST 2010

Hi all,

Once again I turn to this list for help.
I'm trying to build a ditribution for my python package (Python 2.4).
The package has the following structure:

   |- ...
        |- ...
        |- ...
        |- datadir
             |- data1.ext
             |- ...
             |- dataN.ext

My setup script looks like:

from distutils.core import setup

      modemetadata = 'metadatavalue'
      package_dir = {'root': ''},    
      packages = ['root',

My problem is including the data contained in root/subpackage2/dir in the 

I tried using the package_data keyword but couldn't get it right (?). There are 
quite a few posts around and they are very contradictory as to whether or not 
this works... sic !

Then, I wrote a script dile containing:

include root/subpackage2/dir/*

This worked fine for creating the source distribution for Win32 (.zip) using:

python sdist

but not for the (Win32) build distribution:

python bdist_wininst

Can anyone point me in the right direction ? Any help would be much appreciated 



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list