How to distribute an additional DLL to site-packages?

Gabriel Genellina gagsl-py at yahoo.com.ar
Fri Dec 22 15:26:39 EST 2006


Bo Peng ha escrito:

> > I am writing a python extension module that needs to link with a
> > third-party DLL. How can I copy this DLL to the site-packages directory
> > along with my extension modules? It seems that data_files parameter can
> > do this, but I do not know how to get the absolute destination
> > directory. After all, this directory is configurable.
>
> So nobody has ever done this???

Use the package_data option. setup(..., packages=['yyy'],
package_data={'yyy':['xxx.dll']}, ...)
(Distutils documentation may be arcane sometimes, but this is easily
found at http://docs.python.org/dist/node12.html)
Absolute dirs are almost never necesary, usually all distutils commands
operate on relative paths (relative to location of setup.py for source
files, relative to some meaningful directory for targets).

-- 
Gabriel Genellina




More information about the Python-list mailing list