개발/Python

[파이썬] mac 파이썬 설치

soohkang 2020. 8. 29. 21:27
728x90

mac 에는 기본으로 2.7이 설치되어 있는데 학습을 위해 찾은 자료에는 3.8로 사용하라고한다.

 

WARNING: Python 2.7 is not recommended.
This version is included in macOS for compatibility with legacy software.
Future versions of macOS will not include Python 2.7.
Instead, it is recommended that you transition to using 'python3' from within Terminal.

Python 2.7.16 (default, Jun  5 2020, 22:59:21)
[GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.29.20) (-macos10.15-objc- on darwin
Type "help", "copyright", "credits" or "license" for more information.

 

 

brew install python3 를 입력한다.

 

이미 설치되어있다는 워닝을 뿜어낸다

 

(당황)

 

침착하고 brew 를 통해서 python3 를 설치할 수 있는 방법을 찾아본다.

 

상위 블로그에 pyenv를 설치해서 파이썬 버전을 관리하라는 말을 하고 명령어를 나열해주었다. 다 따라서 명령창에 복붙해보았다.

brew install pyenv

echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n  eval "$(pyenv init -)"\nfi' >> ~/.bash_profile

exec "$SHELL"

pyenv install 3.8.4

 

그러곤 python -V 을 입력하면 2.7이 나온다. 기본으로 설정되어있어서 그런가?

 

흠... 궁금하긴 하지만 일단 제쳐두고 python3 를 입력해본다. >>> 기호가 나오면서 파이썬 3.7.9 버전이 명령창이 나온다

 

흠...???

 

역시 설치는 어렵다. 맑은 정신일 때 위에 나온 궁금한 점들을 찾아보기로하자.

'개발 > Python' 카테고리의 다른 글

count(), index() 예시  (0) 2021.02.03
[파이썬 기초] 나누기 연산자  (0) 2020.11.03