Last active
October 13, 2022 13:14
-
-
Save njleonzhang/4067e0867de01a08767ffdcf7d34510b to your computer and use it in GitHub Desktop.
instal python3.7 on centos 7.6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ref: | |
https://github.com/pyenv/pyenv-installer | |
https://github.com/pyenv/pyenv#getting-pyenv | |
1. install pyenv | |
``` | |
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash | |
``` | |
2. init | |
zsh | |
``` | |
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc | |
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc | |
echo 'eval "$(pyenv init -)"' >> ~/.zshrc | |
``` | |
bash | |
``` | |
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc | |
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc | |
echo 'eval "$(pyenv init -)"' >> ~/.bashrc | |
``` | |
3. install python3.7 | |
``` | |
pyenv install 3.7.15 | |
``` | |
4. set python 3.7.15 as python | |
``` | |
pyenv global 3.7.15 | |
``` | |
5. restart console | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment