[Distutils] setup.py#package_data - howto include entire folder when installing

Tarek Ziadé ziade.tarek at gmail.com
Thu Feb 11 00:15:40 CET 2010

On Wed, Feb 10, 2010 at 10:15 PM, Aljoša Mohorović
<aljosa.mohorovic at gmail.com> wrote:
> i've created MANIFEST.in and setup.py and when i call "python setup.py
> sdist" archive is created normally and archive contains all files.
> when i call "python setup.py install" data files are not installed and
> i have no idea why.
> i've been searching for a solution but every combination i've tried failed.
> i usually have only html templates so something like:
> package_data = {'mypkg': ['templates/*.html',]}
> works as expected but now i have a folder with different types of
> files and nested folder structure.
> my question is:
> - how can i define in setup.py to include folder (let's call it
> "data") and everything in data so that when "python setup.py install"
> is called that folder is copied with python code?
> something like "package_data={'mypkg': ['data/*']},"?

How is your project organized precisely ?
Depending on the layout you might need to use the "package_dir" option,


> Aljosa Mohorovic
> _______________________________________________
> Distutils-SIG maillist  -  Distutils-SIG at python.org
> http://mail.python.org/mailman/listinfo/distutils-sig

Tarek Ziadé | http://ziade.org

More information about the Distutils-SIG mailing list