[Python-Dev] re-ordering sys.path
Thomas Heller
thomas.heller@ion-tof.com
Thu, 6 Sep 2001 20:47:57 +0200
> > However, because of PYTHONPATH, the latest version of the module
> > will never be loaded by the interpreter.
Distutils has exactly the same problem (every module/package shipped
int the standard python library has it).
Here's an excerpt from the README:
There's generally no need to install the Distutils under Python
1.6/2.0/2.1. However, if you'd like to upgrade the Distutils in your
Python 1.6 installation, or if future Distutils releases get ahead of
the Distutils included with Python, you might want to install a newer
Distutils release into your Python installation's library.
To do this, you'll need to hide the original Distutils package directory
from Python, so it will find the version you install. For example,
under a typical Unix installation, the "stock" Distutils directory is
/usr/local/lib/python1.6/distutils; you could hide this from Python as
follows:
cd /usr/local/lib/python1.6 # or 2.0
mv distutils distutils-orig
On Windows, the stock Distutils installation is "Lib\distutils" under
the Python directory ("C:\Python" by default with Python 1.6a2 and
later). Again, you should just rename this directory, eg. to
"distutils-orig", so that Python won't find it.
Once you have renamed the stock Distutils directory, you can install the
Distutils as described above.
Thomas