pyenv-sync command and unversioned and major-versioned python 3 symlinks #4664
Replies: 5 comments 1 reply
-
Does running |
Beta Was this translation helpful? Give feedback.
-
I think I have a similar issue. ENV Details~ » brew --config
HOMEBREW_VERSION: 4.2.11-54-g76c7245
ORIGIN: https://github.com/Homebrew/brew
HEAD: 76c7245d10d4f6219a2c3ac9b584dd8d9661087d
Last commit: 3 hours ago
Core tap HEAD: fd602f0a4288b46db0dfc81e29e59fd148bfa2a6
Core tap last commit: 68 minutes ago
Core tap JSON: 06 Mar 19:24 UTC
Core cask tap HEAD: 844c1e835d6f3a2b1071e6debc647b4680a10164
Core cask tap last commit: 70 minutes ago
Core cask tap JSON: 06 Mar 19:24 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 10
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.1.4 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/bin/ruby
CPU: 10-core 64-bit arm_firestorm_icestorm
Clang: 15.0.0 build 1500
Git: 2.44.0 => /opt/homebrew/bin/git
Curl: 8.4.0 => /usr/bin/curl
macOS: 14.3-arm64
CLT: 15.1.0.0.1.1700200546
Xcode: N/A
Rosetta 2: false
Working Behaviourpyenv only works if I don't use a homebrew python version # Working
~ » pyenv global 3.11.3
~ » pyenv versions
system
* 3.11.3 (set by /Users/<user>/.pyenv/version)
3.11.8 --> /opt/homebrew/Cellar/[email protected]/3.11.8
3.12.2 --> /opt/homebrew/Cellar/[email protected]/3.12.2_1
~ » python3 --version
3.11.3
~ » python --version
3.11.3 Broken Behaviourpyenv stops working as soon as I set a homebrew python version ~ » pyenv global 3.11.8
~ » pyenv versions
system
3.11.3
* 3.11.8 --> /opt/homebrew/Cellar/[email protected]/3.11.8 (set by /Users/<user>/.pyenv/version)
3.12.2 --> /opt/homebrew/Cellar/[email protected]/3.12.2_1
~ » python3 --version
3.12.2 # I suspect that is unable to find anything so it falls back to [email protected] located in my PATH
~ » python --version
pyenv: python: command not found
The `python' command exists in these Python versions:
3.11.3 |
Beta Was this translation helpful? Give feedback.
-
Sounds like a legit issue that should be fixed and is probably worth filing in Homebrew/brew! |
Beta Was this translation helpful? Give feedback.
-
I have this same problem. I used pyenv-sync, but the pyenv chosen version was not being used, as designed. I also ran ussing the
but not any Once I added an extra
everything worked as expected. |
Beta Was this translation helpful? Give feedback.
-
I encountered the same issue and created a PR for the |
Beta Was this translation helpful? Give feedback.
-
Output of
brew config
Output of
brew doctor
Description of issue
Recently the PR #15507 (link) added the
pyenv-sync
command that symlinks the brew installed versions into the pyenv versions directory.However there's an issue that it fail to proper find the unversioned and major-versioned links, such as `python', 'python3', 'pip', 'pip3' and so on, example:
Enabling
PYENV_DEBUG
, we can see that it fails to get thepython3
executable at thebin
path, and fallback to the system one installed at/usr/local/bin/python3
.pyenv-which source
(Lines omitted for brevity)
Brew Python formulas create these links at
libexec/bin
instead of thebin
that pyenv looks for, anyone know the reason why?Also another issue is that if you perform a
pyenv install
of a version already symlinked by thepyenv-sync
(and select replace) instead of deleting the symlink and creating a new folder, pyenv actually overrides the contents of the brew installation at Cellar.Some ideas:
Maybe
pyenv-sync
command can create those symlinks at installation bin at Cellar? anyone seems any downside?Or instead of symlinking the root folder create symlinks for the subdirs instead.
Or we can make a PR at pyenv that also seeks at
libexec/bin
sub-folders?Any ideas?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions