Still see system /usr/bin/python after activation
I am learning pyenv.
After reading existing open/closed issue. I finally got pyenv installed on RockLinux 8.5. But when I try to activate 3.9.8 for log4j project, the which python still return /usr/bin/python.
- Please advise where I did wrong. from following log
[me@rocky8t01 ~]$ which python
/usr/bin/python
[me@rocky8t01 ~]$ pyenv --version
pyenv 2.2.3
[me@rocky8t01 ~]$ pyenv activate log4j
pyenv-virtualenv: prompt changing will be removed from future release. configure `export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior.
(log4j) [me@rocky8t01 ~]$ which python
/usr/bin/python
(log4j) [me@rocky8t01 ~]$ pyenv versions
system
3.9.8
3.9.8/envs/log4j
* log4j (set by PYENV_VERSION environment variable)
(log4j) [me@rocky8t01 ~]$ /usr/bin/python -V
Python 3.6.8
(log4j) [me@rocky8t01 ~]$ echo $PATH
/home/me/.pyenv/bin:/home/me/.cargo/bin:/home/me/.local/bin:/home/me/bin:/usr/share/Modules/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
(log4j) [me@rocky8t01 ~]$
- Not sure why activate didn't insert "/home/me/.pyenv/versions/3.9.8/bin/" path into $PATH variable ?
(log4j) [me@rocky8t01 ~]$ export PATH=/home/me/.pyenv/versions/3.9.8/bin:$PATH
(log4j) [me@rocky8t01 ~]$ which python
~/.pyenv/versions/3.9.8/bin/python
(log4j) [me@rocky8t01 ~]$
I have the same issue, but on MacOS 12.0.1.
Solved with adding /.pyenv/shims to PATH (not only /.pyenv/bin). This doc about shims helped me.
export PATH="$HOME/.pyenv/shims:$HOME/.pyenv/bin:$PATH"
I have the same issue, but on MacOS 12.0.1.
Solved with adding /.pyenv/shims to PATH (not only /.pyenv/bin). This doc about shims helped me.
export PATH="$HOME/.pyenv/shims:$HOME/.pyenv/bin:$PATH"
Thanks! That solved my issue on Arch Linux!
Thanks - I had the same issue on Ubuntu 20.04 and the solution above worked.