Opened 14 years ago

Closed 13 years ago

#16287 closed Cleanup/optimization (fixed)

Clarify installation documents relating to location of site-packages

Reported by: Daniele Procida Owned by: nobody
Component: Documentation Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

https://docs.djangoproject.com/en/1.3/topics/install/ assumes that Django will be installed into a site-packages directory, but this isn't a reliable assumption.

Notably, Debian, Ubuntu etc will put it into a dist-packages directory, and the tip to use:

python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"

won't help.

I think that this would be worth noting briefly to help avoid confusion. If that seems appropriate, let me know and I will submit a documentation patch.

Attachments (1)

django-16287.diff (731 bytes ) - added by Bas Peschier 14 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 by Bas Peschier, 14 years ago

The tip actually does work:

Debian squeeze:

bpeschier@fika:~$ python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"
/usr/lib/python2.6/dist-packages

There might be very minimal confusion the name is not site-packages however.

What would your suggestion have been?

comment:2 by Daniele Procida, 14 years ago

On my ubuntu-10.10-server-amd64 python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" returns:

/usr/lib/python2.6/dist-packages

whereas Django 1.2.4 installed from the tarball using python setup.py install actually went into:

/usr/local/lib/python2.6/dist-packages

In other words, not the same dist-packages.

Meanwhile site-packages:

/usr/local/lib/python2.6/site-packages

is completely empty.

It certainly confused me...

I was thinking that the docs should note that it "might" go somewhere else other than site-packages, and not necessarily the place reported by the tip either, in which case to look in any other site-packages/dist-packages directories.

comment:3 by Bas Peschier, 14 years ago

Needs documentation: set
Summary: Clarify installation documents re site-packagesClarify installation documents relating to location of site-packages
Triage Stage: UnreviewedAccepted

Aha! debian/ubuntu have altered distutils to manage where packages will get deployed.

Related discussion: http://mail.python.org/pipermail/distutils-sig/2011-March/017401.html

Either the snippet should be altered to something that also works on debian/ubuntu or the docs should be updated to mention this behaviour.

by Bas Peschier, 14 years ago

Attachment: django-16287.diff added

comment:4 by Bas Peschier, 14 years ago

Has patch: set
Needs documentation: unset

Debian's distutils do not easily surrender their local install path, so I added a paragraph to the docs about the location of site-packages.

comment:5 by Julien Phalip, 14 years ago

Type: UncategorizedCleanup/optimization

comment:6 by Aymeric Augustin, 13 years ago

Triage Stage: AcceptedReady for checkin

comment:7 by Malcolm Tredinnick, 13 years ago

Resolution: fixed
Status: newclosed

In [16647]:

Minor Debian/Ubuntu install instruction update.

This is all a bit of a mess (and fragile and mostly their own fault),
but this at least gives people a clue. Fixes #16287. Patch from
bpeschier.

Note: See TracTickets for help on using tickets.
Back to Top