[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"How to package additional files under site-packages "

Thank you!
I used get_python_lib() for directory in data_files, and it seem to have worked.

Thanks for your assistance!

-----Original Message-----
From: dieter <dieter at>
Sent: Wednesday, March 6, 2019 12:15 PM
To: python-list at
Subject: Re: "How to package additional files under site-packages "

Saba Kauser <skauser at> writes:
> ...
> My package (ibm_db) has LICENSE, and CHANGES files that I want to be available in the same location as my package is installed I.e under site-packages. However, with current, these files get installed under python install path.
> e.g: C:\Users\skauser\AppData\Local\Programs\Python\Python36\LICENSE
> I have specified them as:
> data_files = [ ('', ['./']),
>                ('', ['./CHANGES']),
>                ('', ['./LICENSE']) ]
> Setup(
> ..
> package_data = package_data,
>        data_files   = data_files,
>        include_package_data = True,
>       cmdclass = cmd_class,
> ..)
> Since the directory path is empty, these files get copied under current path of execution. However, I want them to be copied under the install location of my package.
> Is there any other way I can achieve this?

As you do not want to follow my example, maybe read the "setuptools" documentation.

There definitely is a way to achieve your goal -- other than my approach. If necessary override parts of the "distutils/setuptools"

Rocket Software, Inc. and subsidiaries ? 77 Fourth Avenue, Waltham MA 02451 ? Main Office Toll Free Number: +1 855.577.4323
Contact Customer Support:
Unsubscribe from Marketing Messages/Manage Your Subscription Preferences -
Privacy Policy -

This communication and any attachments may contain confidential information of Rocket Software, Inc. All unauthorized use, disclosure or distribution is prohibited. If you are not the intended recipient, please notify Rocket Software immediately and destroy all copies of this communication. Thank you.