Opened 4 years ago

Closed 4 years ago

#16287 closed Cleanup/optimization (fixed)

Clarify installation documents relating to location of site-packages

Reported by: EvilDMP 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 bpeschier 4 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 4 years ago by bpeschier

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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 4 years ago by EvilDMP

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 4 years ago by bpeschier

  • Needs documentation set
  • Summary changed from Clarify installation documents re site-packages to Clarify installation documents relating to location of site-packages
  • Triage Stage changed from Unreviewed to Accepted

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 4 years ago by bpeschier

comment:4 Changed 4 years ago by bpeschier

  • 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 4 years ago by julien

  • Type changed from Uncategorized to Cleanup/optimization

comment:6 Changed 4 years ago by aaugustin

  • Triage Stage changed from Accepted to Ready for checkin

comment:7 Changed 4 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

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