LoginSignup
5
4

More than 3 years have passed since last update.

macOS Mojaveでpygameが動かない

Last updated at Posted at 2019-12-11

だいぶ前にwindows環境で作ったゲームを動かそうと思ってちょっと詰まった

問題

実行環境
- macOS Mojave 10.14.6
- Python 3.6.5
- pygame 1.9.6

何も表示されない、しばらく待っても動かず

ちょっと調べるとこんなものが
https://github.com/pygame/pygame/issues/555

やっぱりmacOSとデフォルトのpygameの相性が悪いっぽいので
versionを指定して最新のもの(2019年12/12時点)にする

# pygame1.9.6をアンインストール
> pip uninstall pygame
Uninstalling pygame-1.9.6:
  Would remove:
    /usr/local/var/pyenv/versions/3.6.5/include/python3.6m/pygame/_camera.h
    /usr/local/var/pyenv/versions/3.6.5/include/python3.6m/pygame/_pygame.h

    ...

    /usr/local/var/pyenv/versions/3.6.5/lib/python3.6/site-packages/pygame/*
Proceed (y/n)? y
  Successfully uninstalled pygame-1.9.6
# versionを指定してpygameをインストール
> pip install pygame==2.0.0.dev6
Collecting pygame==2.0.0.dev6
  Downloading https://files.pythonhosted.org/packages/be/1d/03caf4447ff3f9b4a89e169a35360c95eeaa5f9c4d1312a619ce2b23e5a8/pygame-2.0.0.dev6-cp36-cp36m-macosx_10_11_intel.whl (5.5MB)
     |████████████████████████████████| 5.5MB 3.4MB/s 
Installing collected packages: pygame
Successfully installed pygame-2.0.0.dev6
# 確認
> pip freeze

...

pygame==2.0.0.dev6

無事動作した。

リンク

5
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
4