[tlu] Monterey and TLU

Bruno Voisin bvoisin at icloud.com
Tue Oct 26 18:04:50 CEST 2021


> On 25 Oct 2021, at 21:18, Bruno Voisin <bvoisin at icloud.com> wrote:
> 
> In that case, then the warning when opening TLU is to tell that TLU uses Python 2 and Apple plans to remove Python 2 in a future release (to replace it with Python 3, or remove Python altogether, is unclear).
> 
> The fact is, for the moment it seems Python 2.7 is still provided (in /System/Library/Frameworks/Python.framework/Versions/2.7). So the warning can be safely ignored, I think.


Summarizing some off-list discussion with Herb:


- The warning is



and is indeed about Python. When you click on the "Learn More..." button, you are brought to the page

	https://www.python.org/doc/sunset-python-2/

about the obsolescence of Python 2.


- Adam has made sure (since version 1.13 I think, according to the Release Notes) that TLU runs fine with both Python 2 and 3. It seems to be (a catch by Herb) the shebang line

	#!/usr/bin/python 

for example in /Applications/TeX/TeX Live Utility.app/Contents/Resources/update_check.py, or maybe

	#!/usr/bin/env python

in /Applications/TeX/TeX Live Utility.app/Contents/MacOS/parse_tlpdb.py, that calls the built-in macOS Python, currently Python 2.7. This triggers the above warning.


- Indeed, the built-in Python is 2.7. It lives in

	/System/Library/Frameworks/Python.framework

In Terminal (removing blank lines):

	% python
	WARNING: Python 2.7 is not recommended. 
	This version is included in macOS for compatibility with legacy software. 
	Future versions of macOS will not include Python 2.7. 
	Instead, it is recommended that you transition to using 'python3' from within Terminal.
	Python 2.7.18 (default, Oct  2 2021, 04:20:38) 
	[GCC Apple LLVM 13.0.0 (clang-1300.0.29.1) [+internal-os, ptrauth-isa=deploymen on darwin


- Python 3 is not built-in and comes with the Developer Tools. There are two ways to install the Apple version. If you run python3 in Terminal you get

	% python3                  
	xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.

and at the same an application Install Command Line Developer Tools launches itself offering to install the command line developer tools, which include python3:



No authentication is required, only a Command Line Tools Licence Agreement. Afterwards

	% python3
	Python 3.8.9 (default, Aug  3 2021, 19:21:54) 
	[Clang 13.0.0 (clang-1300.0.29.3)] on darwin

and Python 3 lives in

	/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework


- Alternatively, you may install Xcode from the App Store. In that event, Python 3 will live in

	/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework


- It's unclear what will happen when Apple removes Python 2.7. One possibility is that /usr/bin/python will remain and be altered to point to python3, which either will have replaced Python 2.7 in the OS, or will need to be installed separately as above.

Another possibility is that the python command goes away and only python3 will be recognized by the OS, which (I imagine) would mean the .py scripts would need to test for the available python if any and use explicitly either python or python3 depending on the result.


Maybe this doesn't make sense, I've never really used Python myself.

Bruno

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/tlu/attachments/20211026/5b4bd872/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TLU Warning.png
Type: image/png
Size: 181997 bytes
Desc: not available
URL: <https://tug.org/pipermail/tlu/attachments/20211026/5b4bd872/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Python 3 Installation.png
Type: image/png
Size: 272752 bytes
Desc: not available
URL: <https://tug.org/pipermail/tlu/attachments/20211026/5b4bd872/attachment-0003.png>


More information about the tlu mailing list.