python / cpython

The Python programming language
https://www.python.org
Other
62.29k stars 29.93k forks source link

Enforce and document restrictions for command line installations of python.org macOS installers #122579

Open maltfield opened 5 months ago

maltfield commented 5 months ago

Is your feature request related to a problem? Please describe.

This is a request to update the documentation to include how to actually install Python on MacOS after downloading the .pkg file

Describe the solution you'd like

The documentation should include the commands to run to install the .pkg file and to then open a python interpreter to get a shell in python.

Additional context

This is especially confounding on headless systems. The docs say how to download, but then jump to What you get after installing without saying how the heck you actually do the install...

maltfield commented 5 months ago

See also:

maltfield commented 5 months ago

It appears that you can install the .pkg file with the installer command, but it's still unclear where the heck the python3 binary gets placed. I can't find it anywhere in the dir listed in the output

maltfield@host ~ % installer -pkg python-3.12.2-macos11.pkg -target CurrentUserHomeDirectory
installer: Package name is Python
installer: Installing at base path /Users/maltfield
installer: The install was successful.
maltfield@host ~ % 
ned-deily commented 1 month ago

Sorry for the delay in responding, I just noticed your issue under the website tracker. Judging from the discussion in the linked Stackexchange issue, you have already discovered that the python.org installer for macOS does not currently allow selecting an install location other than in /Library/Frameworks and, optionally in addition, /usr/local/bin. I don't recall ever seeing the use of the -domain option on the installer command. The way the .pkg file is built, you aren't supposed to be able to specify an install location and, if you use the Apple-supplied GUI Installer.app, it will not offer that option. I'm surprised that installer doesn't honor that, as well, but it looks like that has been its behavior for a long time. While there are open issues to support relocatable installs on macOS, I will leave this open to see if there is anything we can do to mitigate the case you ran into here today. Also, including more information on doing command line installs would be a good thing, too.