pyenv / pyenv-installer

This tool is used to install `pyenv` and friends.
MIT License
3.96k stars 428 forks source link

Still see system /usr/bin/python after activation #127

Closed tjyang closed 1 year ago

tjyang commented 2 years ago

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.

- 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 ~]$

nvo87 commented 2 years ago

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"
yenaras commented 2 years ago

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!

bentoner commented 2 years ago

Thanks - I had the same issue on Ubuntu 20.04 and the solution above worked.