The Yosemite (OS X 10.10) upgrade includes Python 2.7.6, and the process, as usual with Apple system updates, seems to completely replace the system packages directory, in
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
This time, the process appears to have entirely omitted site.py
. My understanding was that this file was essential to the functioning of Python, in particular, the proper construction of package search paths; but my Python (which uses nothing more than the Apple system Python and additional packages in site-packages
) works fine, and my paths remain as they were before the upgrade.
Is site.py
no longer needed for proper functioning of Python? Has it been moved to another location?
If the behaviour of python hasn't changed and
sys.path
contains the path to yoursite-packages
folder, you should be fine. If you use the interpreters-S
option, the path to thesite-packages
folder won't show up insys.path
, so you can test it. I would recommend searching for the file on your system. If it doesn't show up, make sure you can see hidden files in case it's hidden for some reason.site.py docs
edit: Resolved in comments, but wanted to provide an official answer.
site.py
is still used. You are just not looking in the right location:The
/Extras
structure appears to consist entirely of non-standard-library packages, e.g. packages that Apple installs for their own uses that are not included with standard Python.If there was a
site.py
file there in previous OS X versions it was in all likelihood one installed bysetuptools
; with 10.10 comessetuptools
1.1.6, which has long since got rid of the hack embodied in that file.