Skip to content

Instantly share code, notes, and snippets.

@liaoyw
Forked from jess-sol/install-pyenv-centos-7
Created December 30, 2024 12:48
Show Gist options
  • Save liaoyw/f6eae05253331c396b593a0981372bea to your computer and use it in GitHub Desktop.
Save liaoyw/f6eae05253331c396b593a0981372bea to your computer and use it in GitHub Desktop.
Install pyenv on CentOS 7 for a specific user with dependencies to manage installed versions of Python
sudo yum install \
git gcc zlib-devel bzip2-devel readline-devel \
sqlite-devel openssl-devel libffi-devel
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
cat <<'EOF' >> ~/.bash_profile
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
EOF
pyenv install 3.7.4
pyenv global 3.7.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment