I installed 3.5.2
and 3.5.3
version using pyenv.
# pyenv versions
* system (set by /usr/local/pyenv/version)
3.5.2
3.5.3
But, when I run this command as sudo
(not login as root
) it not gives me all versions.
$ sudo /usr/local/bin/pyenv versions
* system (set by /root/.pyenv/version)
I tried using setting the PYENV_ROOT
path, but that also not works.
$ export PYENV_ROOT=/usr/local/pyenv/
$ sudo /usr/local/pyenv/bin/pyenv versions
* system (set by /root/.pyenv/version)
I already have path set in .bash_profile
in myuser
$ cat ~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
export PYENV_ROOT=/usr/local/pyenv/
export PATH="/usr/local/pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
Also set in root
user
$ sudo cat /root/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
export PYENV_ROOT=/usr/local/pyenv/
export PATH="/usr/local/pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
I am using centos
$ cat /etc/issue
CentOS release 6.9 (Final)