"python" shim is not used if a user has ran it before installing the first alternative version

未关闭
#2,732 7 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
38/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
python, shell
领域
cli

调研方向

Reproduce the Fedora 38 commands using pyenv install, pyenv local, pyenv rehash, and the python shim, then trace how the selected version is resolved. Done means python --version reports 3.11.4 after selecting it locally, without regressing the working 3.12-dev case.

由索引模型根据 Issue 内容生成。

描述

GNU/Linux Fedora 38 (x86/64), pyenv 2.3.21 (fresh install), gcc 13.1.1

I installed Python version 3.11.4 and use pyenv local 3.11.4 as usual, but shims seem to only use version from the system (3.11.3).

marc@marcbook ~  
$ which python
/usr/bin/python

marc@marcbook ~  
$ python --version
Python 3.11.3

marc@marcbook ~  
$ pyenv install -f 3.11.4
Downloading Python-3.11.4.tar.xz...
-> https://www.python.org/ftp/python/3.11.4/Python-3.11.4.tar.xz
Installing Python-3.11.4...
Installed Python-3.11.4 to /home/marc/.pyenv/versions/3.11.4

marc@marcbook ~  
$ pyenv local 3.11.4

marc@marcbook ~ 3.11.4 
$ pyenv rehash

marc@marcbook ~ 3.11.4 
$ which python
~/.pyenv/shims/python

marc@marcbook ~ 3.11.4 
$ python --version
Python 3.11.3

But it works fine with Python 3.12-dev, so I don't really understand what is going on...

marc@marcbook ~
$ pyenv local 3.12-dev

marc@marcbook ~ 3.12-dev
$ pyenv versions
  system
  3.11.4
* 3.12-dev (set by /home/marc/.python-version)

marc@marcbook ~ 3.12-dev 
$ python --version
Python 3.12.0b3+
主要语言
Shell
星标
45.2k
派生
3.3k
平均合并
2 天 3 分钟
30 天内合并 PR
32

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

pyenv/pyenv 的其他 Issue

查看 pyenv/pyenv 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。