Trouble Installing Pygame on Mac OSX

后端 未结 3 585
抹茶落季
抹茶落季 2020-12-03 12:33

Here is my error message:

Python 2.7.2 (default, Jun 20 2012, 16:23:33) 
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type \"         


        
相关标签:
3条回答
  • 2020-12-03 13:02

    The instructions differ if you have a 32-bit proccessor or a 64-bit one. Users of 32-bit processors should just download and install the binary labeled pygame-1.9.1release-python.org-32bit-py2.7-macosx10.3.dmg on the pygame download page. Users of 64-bit processors should follow the instructions below.

    1. There is no 64-bit version of pygame for Mac OS X. The 32-bit version of pygame is only compatible with a 32-bit version of python. However, there is a warning/caution to be aware of: on Snow Leopard the Apple-provided version of Tcl/Tk (a GUI library which powers IDLE) can be out-of-date and cause problems. Snow Leopard users should first download and install an updated version from here, labeled ActiveTcl 8.4.19.5 under Mac OS X (Universal). This should be installed first. Lion users should ignore this step.

    2. Delete, if already installed, the Python 2.7 folder (most likely in /Applications). This is most likely the 64-bit version of Python that should not be used.

    3. Download and install the 32-bit version of Python 2.7.2 provided here under Python 2.7.2 Mac OS X 32-bit i386/PPC Installer. Regardless of what download page says, this version is compatible on Mac OS X Lion. If you have the correct version, the install size (as displayed in Installer) should be around 90 MB.

    4. Download and install the 32-bit version of pygame, located here.

    5. You can test to see if this has worked by opening IDLE, and typing: import pygame

    If there is no output, it worked. If instead you get a "no matching architecture in universal wrapper" error, then most likely step 2 was skipped.

    0 讨论(0)
  • 2020-12-03 13:08

    Another workaround is to copy the pygame module directly into your project directory.

    The path to pygame on my mac after installing the binary is "/Library/Python/2.7/site-packages/pygame".

    0 讨论(0)
  • 2020-12-03 13:10

    I installed this http://www.pygame.org/ftp/pygame-1.9.2pre-py2.7-macosx10.7.mpkg.zip

    and this: http://xquartz.macosforge.org/landing/

    All started working.

    0 讨论(0)
提交回复
热议问题