Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#6695 closed (invalid)

how to install: site-packages not where the document says it is on OS X

Reported by: Michael S. Owned by: nobody
Component: Documentation Version: 0.96
Severity: Keywords:
Cc: mjs@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description (last modified by Jacob)

The how to install documentation at:

says that if django is installed via " install" django will be installed as a django subdirectory of the site-packages directory. It further suggests that to find the site-packages directory, one should run the following command:

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

However, this seems to produce the wrong output on OS X 10.5: the output it gives is:

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

but the actual directory django was installed in is:


(and this isn't a symlink to the other.)

Change History (6)

comment:1 Changed 9 years ago by grahamd

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

If Django was installed in:


then your Python installation has been broken in some way, or whatever tool you used to install Django is calculating the location of the site-packages directory incorrectly.

The correct location for Python 2.5.1 that comes standard which MacOS X (10.5/Leopard) is:


For the MacOS X supplied version of Python 2.5.1, the site-packages directory under the framework directory shouldn't be used and should never be created. The Python program shouldn't ever look there.

I am still not sure how peoples installations are getting screwed up, but one reason may be where people had installed version of MacPorts 2.5.1 on MacOS X 10.4 and then done an upgrade to MacOS 10.5. Alternatively, some version of setuptools is broken and not doing things correctly.

comment:2 Changed 9 years ago by Michael Stillwell <mjs@…>

I have 10.5, and on my system /usr/bin/python is a symlink to /System/Library/Frameworks/Python.framework/Versions/2.5/bin/python, so the Python.framework stuff does seem to be involved somehow.

I didn't upgrade a MacPorts python from 10.4 to 10.5, but I didn't have an (incomplete) version of MacPorts' python25 installed at one point, though all traces of it should be removed now. (I initially tried to install django via MacPorts but that didn't work.)

comment:3 Changed 9 years ago by Jacob

Description: modified (diff)

comment:4 Changed 9 years ago by grahamd

Your /usr/bin/python is correct and the framework directory is where Python is installed. However, for whatever reason, Apple decided with Python 2.5.1 on MacOS X Leopard not to have the site-packages (user installed code) under the framework directory, but under /Library/Python/2.5 instead. For a clean install of MacOS X there isn't even an empty site-packages directory under the framework directory and well behaved installers don't create one, but always use /Library/Python/2.5/site-packages instead. If you look at sys.path, only the site-packages directory under /Library/Python/2.5 should be listed.

This is in contrast to Python 2.3 on older MacOS X where the physical site-packages directory was under the framework directory and /Library/Python/2.3/site-packages was a symlink pointing back to the site-packages directory under the framework directory. Yet, the sys.path listed the site-packages under the framework directory and not that under /Library/Python/2.3.

I guess where Apple is going with this is that user installed packages aren't meant to be under /System/Library, only OS supplied code should be here. Thus why they put site-packages under /Library instead.

comment:5 Changed 8 years ago by Simon Greenhill

Resolution: invalid
Status: newclosed

Please reopen this if anyone else encounters it - my 10.5 gives the right path too.

comment:6 Changed 8 years ago by Christopher Schmidt <crschmidt@…>

I didn't see this, and opened #7414 instead of reopening this ticket. I had this happen on a clean 10.5 install -- no upgrades involved.

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