본문 바로가기
콤퓨타/Python

MAC에 pygame 설치하기

by 어니엉 2019. 6. 2.
728x90

1. 환경

  OS : MacOS Majave 10.14.5

  python :  3.7

 

2. 설치

python 은 3.7로 하면 버그인지.. pygame을 제대로 설치하고 실행하면 빈 화면만 나온다.

그래서 기존에 설치되어있던 python 3.7을 3.6으로 다운그레이드 해줘야함..

brew unlink python
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb

근데 여기서 

==> Consider using `brew extract python ...`!
This will extract your desired python version to a stable tap instead of
installing from an unstable URL!

######################################################################## 100.0%
Error: python contains a recursive dependency on itself:
  python depends on sphinx-doc
  sphinx-doc depends on python

요런 recursive dependency 관련 에러가 나오면

brew install --ignore-dependencies https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb

이걸 실행해주면 잘 설치됨!

이제 다시 pygame 설치하기

python3 -m pip install -U pygame --user

 

끝!!!

728x90

댓글