Opened 5 years ago

Closed 5 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 5 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 5 years ago by Bas Peschier

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 Changed 5 years ago by Daniele Procida

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 Changed 5 years ago by Bas Peschier

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.

Changed 5 years ago by Bas Peschier

Attachment: django-16287.diff added

comment:4 Changed 5 years ago by Bas Peschier

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 Changed 5 years ago by Julien Phalip

Type: UncategorizedCleanup/optimization

comment:6 Changed 5 years ago by Aymeric Augustin

Triage Stage: AcceptedReady for checkin

comment:7 Changed 5 years ago by Malcolm Tredinnick

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