Installing Pygame for Mac OS X 10.6.8

后端 未结 5 1652
花落未央
花落未央 2020-11-30 05:01

Using Python 2.7.2. When I try to import pygame I get this error message:

Traceback (most recent call last):
  File \"\", line 1, in 

        
5条回答
  •  醉话见心
    2020-11-30 05:45

    The Python 2.7.3 .dmg Mac OS installer installs both 64-bit and 32-bit binaries in:

    /Library/Frameworks/Python.framework/Versions/2.7/bin/

    There is a 32-bit binary called python2.7-32 in that folder.

    To use it in the Terminal simply type $ python2.7-32 instead of python

    To use it in IDLE simply rename the 64-bit python2.7 binary to something like python2.7-64 then rename python2.7-32' topython2.7` and next time you launch IDLE or the Terminal it will use the 32-bit binary. Change it back when you are done.

    You can also force launch IDLE in 32-bit mode from the Terminal:

    $ arch -i386 /Library/Frameworks/Python.framework/Versions/2.7/bin/idle2.7 -n

    You can create a shell script Automator application to make it easier to launch.

提交回复
热议问题