### python 버전 관리툴 pyenv 사용하기 (CentOS)
#필수 패키지 설치
$ yum install -y bzip2 bzip2-devel curl gcc gcc-c++ git libffi-devel make openssl-devel readline-devel sqlite sqlite-devel xz xz-devel zlib-devel
# pyenv 설치
$ curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
# bash_profile에 환경변수 설정
$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
$ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(pyenv init --path)"' >> ~/.bash_profile
$ echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
source ~/.bash_profile
export PATH
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
# pyenv 업데이트 여부 확인
$ pyenv update
# 설치가능 리스트 확인
pyenv install -list
Available versions:
2.1.3
2.2.3
2.3.7
2.4.0
# python 3.9.5 버전 설치 하기 (2021-06-30일 기준)
pyenv install 3.9.5
## 설치된 버전 리스트 확인
pyenv versions
* system (set by /Users/dragonfog/.pyenv/version)
2.7.18
3.9.5
## Default python 버전을 3.9.5 로 설정
$ pyenv shell 3.9.5
## 버전체크
$ python --version
'developer > python' 카테고리의 다른 글
| python 설치하기 (인터넷 환경) (0) | 2022.03.07 |
|---|---|
| python 버전 관리툴 pyenv 사용하기 (mac) (0) | 2021.06.30 |