Use python 3.6.1 or greater, because it is much friendlier to newbies, and additionally runs faster. The best way to install pygame is with the pip tool (which is what python uses to install packages). Restart your mac. 4) Installing Python3 and PyGame Now that all the dependencies are taken care of, we can install Python and pygame. To install python and the tools we will need, type the command: brew install python3 hg sdl sdl_image sdl_mixer sdl_ttf portmidi This will install python along with several other packages required for PyGame via Homebrew.
Does anyone know how to install pygame for use with python 3? I have tried using these instructions: I managed to get everything to work until the pip installation. I did manage to get pip installed (not sure if it installed correctly though) but cannot get pygame to install.
Is there another method or a package already made that is not on the pygame.org site? Any help would be appreciated. Thanks Update: I managed to get pygame to install for python 3.3 however, I do get an error when trying to execute some code. The error is a pygame.mixer stating it cannot load the sound file. I tried it in Windows with Parallels and it works perfectly. As far as I can tell all dependencies are installed per the instructions from the link supplied.
![Pygame Pygame](https://i.ytimg.com/vi/7v_peS6n2Uk/maxresdefault.jpg)
Replacing Mac OS X's system Python is not recommended due to incompatability with other software. However, there are Mac binaries on the that can be installed to a different location. Once installed, you may need to change your PATH environment variable so the new Python interpreter will run when python is invoked from the command line. To edit your PATH, determine the absolute folder path containing the Python binary. This may look something like /Applications/Python/./bin. Add the following line to your /.bashprofile file: export PATH=/path/to/new/python/bin:$PATH The change will take effect after you restart your shell.
'Traceback (most recent call last): File ', line 1, in File '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/init.py', line 95, in from pygame.base import. ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/base.so, 2): no suitable image found. Did find: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygame/base.so: no matching architecture in universal wrapper' – Jun 19 '14 at 7:18. The easiest, non-intrusive way would be to use: /usr/bin/ruby -e '$(curl -fsSL Then, read the instructions that are printed from your shell.
Installing Python 3 With Homebrew you can install Python 3.x: brew install python This will put a python3 binary in /usr/local/bin, and a python binary pointing to python3 in /usr/local/opt/python/libexec/bin. You will additionally get a pip3 command for that version of Python. These formulas will not conflict or take precedence over the system packages unless you override your PATH. That is, if you want python to refer to python3, add the following to your shell config: export PATH=/usr/local/opt/python/libexec/bin:$PATH Read the for more info.
Installing Python 2.7 You can also get an up-to-date version of Python 2.7, if you require that for legacy reasons: brew install python@2 This will give you a python2 binary, and it will override the system python to use the Homebrew-built Python 2.7.