I installed Pygame with Python 3.5.1 in the environment of pyenv on OS X

Pygame support is over long ago

Pygame is not compatible with python3 series and is already outdated, but pysdl2 is not as easy as pygame and it is not a thick wrapper.

This time I wanted to make something simple quickly, so I decided to use pygame with python3 series.

By the way, it seems that downloading by this method is good even for 2 series.

Installation

First of all, installation of necessary items

Installation


brew install mercurial
brew install git 
brew install sdl sdl_image sdl_mixer sdl_ttf smpeg portmidi

Then install pygame using pip

pip install hg+http://bitbucket.org/pygame/pygame

During the installation with pip, this came out スクリーンショット 2016-06-01 02.23.10.png

I didn't expect it to come out like this from the gui side, but I followed the instructions to resolve the dependency.

Verification

Verification


>>> import pygame
>>> pygame.init()
2016-06-01 02:46:59.521 python3[55786:2013267] 02:46:59.521 WARNING:  140: This application, or a library it uses, is using the deprecated Carbon Component Manager for hosting Audio Units. Support for this will be removed in a future release. Also, this makes the host incompatible with version 3 audio units. Please transition to the API's in AudioComponent.h.
(6, 0)
>>> pygame.display.set_mode((500, 500))
<Surface(500x500x32 SW)>
>>> exit()

It works and there is a problem ~~ no ~~

Apparently the KEY related event is it doesn't seem to work.

It seems that there is no choice but to touch pysdl2 with 3 series ...

Recommended Posts

I installed Pygame with Python 3.5.1 in the environment of pyenv on OS X
I want to use Python in the environment of pyenv + pipenv on Windows 10
Build a python environment with pyenv (OS X El Capitan 10.11.3)
I set the python operating environment on OSX Yosemite (pyenv + pip)
I couldn't use tkinter with python installed by pyenv of anyenv
Django cannot be installed in the development environment of pipenv + pyenv
Continuation ・ Notes on preparing the Python development environment on Mac OS X
Get a list of packages installed in your current environment with python
Build an environment with pyenv, pyenv-virtualenv, jupyter on OS X El Capitan
I set the environment variable with Docker and displayed it in Python
I tried with the top 100 PyPI packages> I tried to graph the packages installed on Python
Prepare the execution environment of Python3 with Docker
Build python environment with pyenv on EC2 (ubuntu)
Use multiple versions of python environment with pyenv
Put Python 2.7.x on Mac OSX 10.15.5 with pyenv
I tried to graph the packages installed in Python
The story of sharing the pyenv environment with multiple users
Use Python installed with pyenv for PL / Python execution environment
I made a Python3 environment on Ubuntu with direnv.
Build a Python development environment on Mac OS X
Install the latest Python from pyenv installed with homebrew
Create a Python development environment on OS X Lion
Use python installed with Pyenv with Sublime REPL of Sublime Text 3
[Python & SQLite] I tried to analyze the expected value of a race with horses in the 1x win range ①
[Example of Python improvement] I learned the basics of Python on a free site in 2 weeks.
[Python & SQLite] I analyzed the expected value of a race with horses with a win of 1x ②
I tried to build an environment for machine learning with Python (Mac OS X)
I tried to find the entropy of the image with python
Try scraping the data of COVID-19 in Tokyo with Python
I tried "gamma correction" of the image with Python + OpenCV
I tried the accuracy of three Stirling's approximations in python
Using multiple versions of Python on Mac OS X (2) Usage
Unify the environment of the Python development team starting with Poetry
Check the operation of Python for .NET in each environment
Calculate the square root of 2 in millions of digits with python
I wrote the basic grammar of Python with Jupyter Lab
I evaluated the strategy of stock system trading with Python.
Test Python with Miniconda on OS X and Linux with travis-ci
[Homology] Count the number of holes in data with Python
I wrote a doctest in "I tried to simulate the probability of a bingo game with Python"
I tried running the offline speech recognition system Julius with python in the Docker virtual environment
Use Python in pyenv with NeoVim
I liked the tweet with python. ..
Environment construction of python3.8 on mac
I wrote the queue in Python
I wrote the stack in Python
Life game with Python [I made it] (on the terminal & Tkinter)
Specify the encoding of the unicode string in the Python 2.x print statement
I compared the speed of Hash with Topaz, Ruby and Python
I tried scraping the ranking of Qiita Advent Calendar with Python
How is the progress? Let's get on with the boom ?? in Python
I compared the calculation time of the moving average written in Python
[Python] I wrote the route of the typhoon on the map using folium
Using multiple versions of Python on Mac OS X (1) Multiple Ver installation
[Understanding in the figure] Management of Python virtual environment by Pipenv
I want to output the beginning of the next month with Python
Output the contents of ~ .xlsx in the folder to HTML with Python
Quickly install OpenCV 2.4 (+ python) on OS X and try the sample
How to use python put in pyenv on macOS with PyCall
I wrote the code to write the code of Brainf * ck in python
I studied with Kaggle Start Book on the subject of kaggle [Part 1]