반응형
### python 버전 관리툴 pyenv 사용하기 (Mac)
Github : https://github.com/pyenv/pyenv
homebrew가 설치되어 있으면 아래와 같이 설치가 가능함
$ brew install pyenv
설치 가능 리스트 확인
$ pyenv install -list or pyenv install -l
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 shell
: 사용을 위해서는 먼저 pyenv init - 명령어 실행이 필요함
$ pyenv shell
pyenv: shell integration not enabled. Run `pyenv init' for instructions
$ pyenv init
# Load pyenv automatically by appending
# the following to ~/.bash_profile:
eval "$(pyenv init -)"
.bash_profile 에 eval "$(pyenv init -)" 를 추가 해주라고 한다.
.bash_profile에 아래와 같이 추가 해준다.
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
## 설치된 버전 리스트 확인
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 사용하기 (CentOS) (0) | 2021.06.30 |