Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brew link python@3.12 does not create python3 pip3 symlinks #149998

Closed
4 tasks done
PabloLION opened this issue Oct 7, 2023 · 3 comments
Closed
4 tasks done

brew link python@3.12 does not create python3 pip3 symlinks #149998

PabloLION opened this issue Oct 7, 2023 · 3 comments
Labels
bug Reproducible Homebrew/homebrew-core bug outdated PR was locked due to age

Comments

@PabloLION
Copy link

brew gist-logs <formula> link OR brew config AND brew doctor output

brew config

HOMEBREW_VERSION: 4.1.14
ORIGIN: https://github.com/Homebrew/brew
HEAD: affc4c01aada2c973b63e084e7696e896edf2b7b
Last commit: 5 days ago
Core tap JSON: 07 Oct 01:42 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_EDITOR: code --wait
HOMEBREW_MAKE_JOBS: 20
Homebrew Ruby: 2.6.10 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: 20-core 64-bit arm_firestorm_icestorm
Clang: 14.0.3 build 1403
Git: 2.39.2 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 8.1.2 => /usr/bin/curl
macOS: 14.0-arm64
CLT: 14.3.1.0.1.1683849156
Xcode: N/A
Rosetta 2: false

Verification

  • My "brew doctor output" says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.
  • I searched for recent similar issues at https://github.com/Homebrew/homebrew-core/issues?q=is%3Aissue and found no duplicates.

What were you trying to do (and why)?

I am tying to install a new python version python@3.12 then link pip3 to pip3.12 like what was done for python@3.11

What happened (include all command output)?

brew link python@3.12 only creates 11 symlinks instead of 25 like brew link python@3.11
The 11 links created by brew link python@3.12 are:

/opt/homebrew/bin/2to3-3.12
/opt/homebrew/bin/idle3.12
/opt/homebrew/bin/pip3.12
/opt/homebrew/bin/pydoc3.12
/opt/homebrew/bin/python3.12
/opt/homebrew/bin/python3.12-config
/opt/homebrew/bin/wheel3.12
/opt/homebrew/lib/pkgconfig/python-3.12-embed.pc
/opt/homebrew/lib/pkgconfig/python-3.12.pc
/opt/homebrew/share/man/man1/python3.12.1
/opt/homebrew/Frameworks/Python.framework/Versions/3.12

The 25 links created by brew link python@3.11 are:

/opt/homebrew/bin/2to3
/opt/homebrew/bin/2to3-3.11
/opt/homebrew/bin/idle3
/opt/homebrew/bin/idle3.11
/opt/homebrew/bin/pip3
/opt/homebrew/bin/pip3.11
/opt/homebrew/bin/pydoc3
/opt/homebrew/bin/pydoc3.11
/opt/homebrew/bin/python3
/opt/homebrew/bin/python3-config
/opt/homebrew/bin/python3.11
/opt/homebrew/bin/python3.11-config
/opt/homebrew/bin/wheel3
/opt/homebrew/bin/wheel3.11
/opt/homebrew/lib/pkgconfig/python-3.11-embed.pc
/opt/homebrew/lib/pkgconfig/python-3.11.pc
/opt/homebrew/lib/pkgconfig/python3-embed.pc
/opt/homebrew/lib/pkgconfig/python3.pc
/opt/homebrew/share/man/man1/python3.1
/opt/homebrew/share/man/man1/python3.11.1
/opt/homebrew/Frameworks/Python.framework/Headers
/opt/homebrew/Frameworks/Python.framework/Python
/opt/homebrew/Frameworks/Python.framework/Resources
/opt/homebrew/Frameworks/Python.framework/Versions/3.11
/opt/homebrew/Frameworks/Python.framework/Versions/Current

What did you expect to happen?

important executable files like pip3, python3 should be linked by brew link python@3.12.
Some additional information:

Step-by-step reproduction instructions (by running brew commands)

- uninstall then (re)install `python@3.11 and python@3.12`

brew uninstall python@3.11 ; brew uninstall python@3.12 ; brew reinstall python@3.11 && brew reinstall python@3.12


- see the links would be unlinked via (including the first line `Would remove:`)
```sh
brew unlink -n python@3.11 | wc -l ; brew unlink -n python@3.12 | wc -l
  • or see the full content with
brew unlink -n python@3.11 ; brew unlink -n python@3.12
  • doing them separately yields the same result, since the files have no intersection
brew uninstall python@3.11 -q ; brew reinstall python@3.11 -q ; echo ; echo ; brew unlink -n python@3.11 | wc -l ; echo ; echo ; brew uninstall python@3.11 -q
brew uninstall python@3.12 -q ; brew reinstall python@3.12 -q ; echo ; echo ; brew unlink -n python@3.11 | wc -l ; echo ; echo ; brew uninstall python@3.12 -q
  • uninstall unwanted python version if needed
@PabloLION PabloLION added the bug Reproducible Homebrew/homebrew-core bug label Oct 7, 2023
@ZhongRuoyu ZhongRuoyu changed the title `brew link python@3.11 brew link python@3.12 does not create python3 pip3 symlinks Oct 7, 2023
@ZhongRuoyu
Copy link
Member

ZhongRuoyu commented Oct 7, 2023

This is expected behaviour; the brew unlink $old_version && brew link $new_version may work for some other versioned formulae, but not python. All python versions are already linked into HOMEBREW_PREFIX, but only the "default" version links the unversioned (e.g. python, pip) and major-versioned symlinks (e.g. python3, pip3) into the prefix. Currently, the default version is still python@3.11.

To use python@3.12's python3 pip3 symlinks, see caveats in brew info python@3.12 (which should also be printed if you manually installed it):

Unversioned and major-versioned symlinks `python`, `python3`, `python-config`, `python3-config`, `pip`, `pip3`, etc. pointing to
`python3.12`, `python3.12-config`, `pip3.12` etc., respectively, have been installed into
  /opt/homebrew/opt/python@3.12/libexec/bin

@ZhongRuoyu ZhongRuoyu closed this as not planned Won't fix, can't repro, duplicate, stale Oct 7, 2023
@PabloLION
Copy link
Author

PabloLION commented Oct 7, 2023

Thanks for the quick response. I see the difference in the Caveats part. What I'm wondering is why is python3.11 a default version and python3.12 is not? And, who decides this? Is it because of the distultils?

Would you be so kind to educate me? I did my search, and saw that it's not like NodeJS' LTS version, and bing chat says

It’s possible that Python 3.11 is still the default on some systems because they haven’t been updated to use Python 3.12 as the default yet.

Does this mean python3.12 would become a "default" version some time later?
Thanks in advance.

@ZhongRuoyu
Copy link
Member

What I'm wondering is why is python3.11 a default version and python3.12 is not?

Because we need to migrate the Python dependents to 3.12, and this takes time. You can already see a number of PRs in progress (they are tagged https://github.com/Homebrew/homebrew-core/labels/python-3.12-migration). We can't migrate all of them at once because there can be a nontrivial number of failures.

Does this mean python3.12 would become a "default" version some time later?

Yes. See also #114154 (python@3.11) and #87075 (python@3.10).

@github-actions github-actions bot added the outdated PR was locked due to age label Nov 7, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Reproducible Homebrew/homebrew-core bug outdated PR was locked due to age
Projects
None yet
Development

No branches or pull requests

2 participants