What's .pydistutils.cfg for?

ilciavo picture ilciavo · Sep 18, 2014 · Viewed 8.7k times · Source

I work on two servers, and on one server .pydistutils.cfg looks like:

install_scripts=~/opt_old/bin
install_data=~/opt_old/share
install_lib=~/usr/lib/python2.6/site-packages

I think, this creates problems with using pip and linking libraries on local versions of python.

On the second server, the file is non existent, and I don't have any issues.

Why do we need this file and why is PYTHONPATH not sufficient?

I installed a local version of Python and renamed the file .pydistutils.cfg. Hence, it seems that the file is not that important.

Answer

Dima Tisnek picture Dima Tisnek · Sep 19, 2014

A pretty good write-up is here:

http://bouktin.blogspot.com/2012/04/configure-pydistutilscfg-python.html

I don't immediately see a reason why an average developer should use it, it seems a bit kludgy to me, perhaps it makes sense if you make your own distro, target docker or similar distribution system or target an embedded system?

Here's a super-simple usage example:

https://github.com/amolenaar/gaphor/wiki/Custom-Python-Installation-Location