New Django installation
Saturday, March 25th, 2006I just got a new machine, with x64 processor (Pentium D Dual Core — nice machine!) and naturally it’s already running Linux. SUSE 10, to be specific.
Now I wanted to move my Django project over from the old machine and the Django installation kept failing. The setup.py told me:
Installed /home/tietze/temp/Django-0.91
Because this distribution was installed --multi-version or --install-dir,
before you can import modules from this package in an application, you
will need to 'import pkg_resources' and then use a 'require()' call
similar to one of these examples, in order to select the desired version:
pkg_resources.require("Django") # latest installed version
pkg_resources.require("Django==0.91") # this exact version
pkg_resources.require("Django>=0.91") # this version or higher
But calling django-admin.py always resulted in
No module named pkg_resources
– no mater how often I ran ez_setup.py or whatever. This was rather frustrating, since the Django installations on my previous machine were such a breeze.
It appears that the Python packaging tool is confused by the fact that 64 bit SUSE puts Python stuff under /usr/lib64 instead of /usr/lib and then assumes that it was installed to a non-standard location which isn’t on any Python path.
I finally found the solution here:
http://www.mail-archive.com/distutils-sig@python.org/msg01667.html
Specifically this recommendation:
“They need to add:
[easy_install]
site_dirs = /usr/lib64/python2.4/site-packages
to /usr/lib64/python2.4/distutils/distutils.cfg. This file probably
doesn’t exist; just create it.”
That did it. Created file, re-ran python ez_setup.py -U setuptools and then python setup.py install and now my new Django installation seems to be working. After a couple of minutes of frustration, that was actually quite easy.



