Skip to content

Instantly share code, notes, and snippets.

@njleonzhang
Last active October 13, 2022 13:14
Show Gist options
  • Save njleonzhang/4067e0867de01a08767ffdcf7d34510b to your computer and use it in GitHub Desktop.
Save njleonzhang/4067e0867de01a08767ffdcf7d34510b to your computer and use it in GitHub Desktop.
instal python3.7 on centos 7.6
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