home ¦ Archives ¦ Atom ¦ RSS

A Python Distutils Tip

Parkin’ this in case it helps someone else, including me in the future. Oddly difficult to find documentation on the feature, the closest being an aside on distutils config files.

When building a Python package that has a C extension you can build the extension separately, using the build_ext command. This allows you to control the include directories, link directories, and link libraries. Handy for those ornery libraries that you just can’t install in /usr/lib or thereabouts. I recently needed it for geos and Shapely.

© 2008-2024 C. Ross Jam. Built using Pelican. Theme based upon Giulio Fidente’s original svbhack, and slightly modified by crossjam.