Issue #28440: No longer add /Library/Python/site-packages, the Apple-supplied
system Python site-packages directory, to sys.path for macOS framework builds. The coupling between the two Python instances often caused confusion and, as of macOS 10.12, changes to the site-packages layout can cause pip component installations to fail. This change reverts the effects introduced in 2.7.0 by Issue #4865. If you are using a package with both the Apple system Python 2.7 and a user-installed Python 2.7, you will need to ensure that copies of the package are installed with both Python instances.
This commit is contained in:
parent
7653c3806c
commit
32b3734866
|
@ -2343,6 +2343,18 @@ Port-Specific Changes: Mac OS X
|
|||
installation and a user-installed copy of the same version.
|
||||
(Changed by Ronald Oussoren; :issue:`4865`.)
|
||||
|
||||
.. versionchanged:: 2.7.13
|
||||
|
||||
As of 2.7.13, this change was removed.
|
||||
``/Library/Python/2.7/site-packages``, the site-packages directory
|
||||
used by the Apple-supplied system Python 2.7 is no longer appended to
|
||||
``sys.path`` for user-installed Pythons such as from the python.org
|
||||
installers. As of macOS 10.12, Apple changed how the system
|
||||
site-packages directory is configured, which could cause installation
|
||||
of pip components, like setuptools, to fail. Packages installed for
|
||||
the system Python will no longer be shared with user-installed
|
||||
Pythons. (:issue:`28440`)
|
||||
|
||||
Port-Specific Changes: FreeBSD
|
||||
-----------------------------------
|
||||
|
||||
|
|
|
@ -295,15 +295,6 @@ def getsitepackages():
|
|||
else:
|
||||
sitepackages.append(prefix)
|
||||
sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
|
||||
if sys.platform == "darwin":
|
||||
# for framework builds *only* we add the standard Apple
|
||||
# locations.
|
||||
from sysconfig import get_config_var
|
||||
framework = get_config_var("PYTHONFRAMEWORK")
|
||||
if framework:
|
||||
sitepackages.append(
|
||||
os.path.join("/Library", framework,
|
||||
sys.version[:3], "site-packages"))
|
||||
return sitepackages
|
||||
|
||||
def addsitepackages(known_paths):
|
||||
|
|
|
@ -233,19 +233,8 @@ class HelperFunctionsTests(unittest.TestCase):
|
|||
self.assertEqual(len(dirs), 1)
|
||||
wanted = os.path.join('xoxo', 'Lib', 'site-packages')
|
||||
self.assertEqual(dirs[0], wanted)
|
||||
elif (sys.platform == "darwin" and
|
||||
sysconfig.get_config_var("PYTHONFRAMEWORK")):
|
||||
# OS X framework builds
|
||||
site.PREFIXES = ['Python.framework']
|
||||
dirs = site.getsitepackages()
|
||||
self.assertEqual(len(dirs), 3)
|
||||
wanted = os.path.join('/Library',
|
||||
sysconfig.get_config_var("PYTHONFRAMEWORK"),
|
||||
sys.version[:3],
|
||||
'site-packages')
|
||||
self.assertEqual(dirs[2], wanted)
|
||||
elif os.sep == '/':
|
||||
# OS X non-framwework builds, Linux, FreeBSD, etc
|
||||
# OS X, Linux, FreeBSD, etc
|
||||
self.assertEqual(len(dirs), 2)
|
||||
wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3],
|
||||
'site-packages')
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
{\rtf1\ansi\ansicpg1252\cocoartf1347\cocoasubrtf570
|
||||
{\rtf1\ansi\ansicpg1252\cocoartf1504\cocoasubrtf750
|
||||
{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fmodern\fcharset0 CourierNewPSMT;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
{\*\expandedcolortbl;;}
|
||||
\margl1440\margr1440\vieww15240\viewh15540\viewkind0
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
|
||||
|
||||
\f0\fs24 \cf0 This package will install Python $FULL_VERSION for Mac OS X $MACOSX_DEPLOYMENT_TARGET for the following architecture(s): $ARCHITECTURES.\
|
||||
\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
|
||||
|
||||
\b \cf0 \ul \ulc0 Which installer variant should I use?
|
||||
\b0 \ulnone \
|
||||
|
@ -36,8 +37,26 @@ To use IDLE or other programs that use the Tkinter graphical user interface tool
|
|||
\i0 for this version of Python and of Mac OS X.\
|
||||
|
||||
\b \ul \
|
||||
Installing on OS X 10.8 (Mountain Lion) or later systems\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
|
||||
\cf0 Packages installed with the system Python 2.7 are no longer searched for\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
|
||||
\cf0 \ulnone [CHANGED for Python 2.7.13]
|
||||
\b0 \
|
||||
\
|
||||
As of Python 2.7.0, user-installed Python 2.7 versions from python.org installers added the system-wide site-packages directory for the Apple-supplied Python 2.7 to the end of their search path. This meant that packages installed with the system Python 2.7 could also be used by the user-installed Python 2.7. While sometimes convenient, this also often caused confusion with the implicit coupling between the two Python instances. Separately, as of macOS 10.12, Apple changed the layout of the system site-packages directory,
|
||||
\f1 /Library/Python/2.7/site-packages
|
||||
\f0 , in a way that can now cause installation of
|
||||
\f1 pip
|
||||
\f0 components to fail. To avoid the confusion and the installation failures, as of 2.7.13 user-installed Pythons no longer add
|
||||
\f1 /Library/Python/2.7/site-packages
|
||||
\f0 to
|
||||
\f1 sys.path
|
||||
\f0 . If you are using a package with both a user-installed Python 2.7 and the system Python 2.7, you will now need to ensure that separate copies of the package are installed for each instance.\
|
||||
\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
|
||||
|
||||
\b \cf0 \ul Installing on OS X 10.8 (Mountain Lion) or later systems\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
|
||||
\cf0 \ulnone [CHANGED for Python 2.7.9]
|
||||
\b0 \
|
||||
\
|
||||
|
@ -45,10 +64,10 @@ As of Python 2.7.9, installer packages from python.org are now compatible with t
|
|||
\i Install Python
|
||||
\i0 installer window. Refer to Apple\'92s support pages for {\field{\*\fldinst{HYPERLINK "http://support.apple.com/kb/ht5290"}}{\fldrslt more information on Gatekeeper}}.\
|
||||
\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
|
||||
|
||||
\b \cf0 \ul Simplified web-based installs\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
|
||||
\cf0 \ulnone [NEW for Python 2.7.9]
|
||||
\b0 \
|
||||
\
|
||||
|
@ -58,10 +77,10 @@ With the change to the newer flat format installer package, the download file no
|
|||
\f1 .dmg
|
||||
\f0 ) container. If you download the Python installer through a web browser, the OS X installer application may open automatically to allow you to perform the install. If your browser settings do not allow automatic open, double click on the downloaded installer file.\
|
||||
\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
|
||||
|
||||
\b \cf0 \ul New Installation Options and Defaults\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
|
||||
\cf0 \ulnone [NEW for Python 2.7.9]
|
||||
\b0 \
|
||||
\
|
||||
|
@ -77,10 +96,10 @@ The Python installer now includes an option to automatically install or upgrade
|
|||
\i Release Notes
|
||||
\i0 link for this release at {\field{\*\fldinst{HYPERLINK "https://www.python.org/downloads/"}}{\fldrslt https://www.python.org/downloads/}}.\
|
||||
\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
|
||||
|
||||
\b \cf0 \ul Certificate verification and OpenSSL\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
|
||||
\cf0 \ulnone [CHANGED for Python 2.7.9]
|
||||
\b0 \
|
||||
\
|
||||
|
@ -132,17 +151,17 @@ For OS X 10.6+, Apple also provides
|
|||
The bundled
|
||||
\f1 pip
|
||||
\f0 included with 2.7.9 has its own default certificate store for verifying download connections.\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
|
||||
|
||||
\b \cf0 \ul \
|
||||
Binary installer support for OS X 10.4 and 10.3.9 discontinued\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
|
||||
\cf0 \ulnone [CHANGED for Python 2.7.9]
|
||||
\b0 \
|
||||
\
|
||||
As previously announced, binary installers for Python 2.7.9 from python.org no longer support Mac OS X 10.3.9 (Panther) and 10.4.x (Tiger) systems. These systems were last updated by Apple in 2005 and 2007. As of 2.7.9, the 32-bit-only installer supports PPC and Intel Macs running OS X 10.5 (Leopard). 10.5 was the last OS X release for PPC machines (G4 and G5). The 64-/32-bit installer configuration remains unchanged and should normally be used on OS X 10.6 (Snow Leopard) and later systems. This aligns Python 2.7.x installer configurations with those currently provided with Python 3.x. If needed, it is still possible to build Python from source for 10.3.9 and 10.4.\
|
||||
\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
|
||||
|
||||
\b \cf0 \ul Python 3 and Python 2 Co-existence\
|
||||
|
||||
|
|
13
Misc/NEWS
13
Misc/NEWS
|
@ -336,6 +336,19 @@ Windows
|
|||
- Issue #27888: Prevent Windows installer from displaying console windows and
|
||||
failing when pip cannot be installed/uninstalled.
|
||||
|
||||
Mac OS X
|
||||
--------
|
||||
|
||||
- Issue #28440: No longer add /Library/Python/site-packages, the Apple-supplied
|
||||
system Python site-packages directory, to sys.path for macOS framework builds.
|
||||
The coupling between the two Python instances often caused confusion and, as
|
||||
of macOS 10.12, changes to the site-packages layout can cause pip component
|
||||
installations to fail. This change reverts the effects introduced in 2.7.0
|
||||
by Issue #4865. If you are using a package with both the Apple system Python
|
||||
2.7 and a user-installed Python 2.7, you will need to ensure that copies of
|
||||
the package are installed with both Python instances.
|
||||
|
||||
|
||||
What's New in Python 2.7.12?
|
||||
============================
|
||||
|
||||
|
|
Loading…
Reference in New Issue