Skip to content

Instantly share code, notes, and snippets.

@aruruka
Last active December 25, 2021 08:47
Show Gist options
  • Save aruruka/5fd9b35ae898af7c34e2a89d68e57772 to your computer and use it in GitHub Desktop.
Save aruruka/5fd9b35ae898af7c34e2a89d68e57772 to your computer and use it in GitHub Desktop.
install pyenv on CentOS
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
cd ~/.pyenv && src/configure && make -C src
echo -e 'if shopt -q login_shell; then' \
'\n export PYENV_ROOT="$HOME/.pyenv"' \
'\n export PATH="$PYENV_ROOT/bin:$PATH"' \
'\n eval "$(pyenv init --path)"' \
'\nfi' >> ~/.bashrc
echo -e 'if [ -z "$BASH_VERSION" ]; then'\
'\n export PYENV_ROOT="$HOME/.pyenv"'\
'\n export PATH="$PYENV_ROOT/bin:$PATH"'\
'\n eval "$(pyenv init --path)"'\
'\nfi' >> ~/.profile
echo -e 'source ~/.profile' >> ~/.bash_profile
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bash_profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment