How to set up pygame with Eclipse?

后端 未结 3 2047
旧时难觅i
旧时难觅i 2021-01-06 14:11

Edit3: Additional information: I was able to get the Eclipse/pygame combo running on Windows... just not on MacOSX.


Edit2: Compiling from the shell also works.

3条回答
  •  执笔经年
    2021-01-06 14:50

    OK, I found the solution how to get it working. The key issues was that Eclipse chooses the 'wrong' interpreter. The Eclipse choice works fine for normal python stuff but when trying to compile pygame things it gets complicated and I get architecture errors.

    So what I did:

    1. Get Eclipse Classic 3.7.2 32-bit here and install it.
    2. Install pydev for Eclipse (instructions for that here)
    3. Getting Python 2.7.3 for Mac OS X 10.3 (here) and install it
    4. Getting Pygame 1.9.1 32-bit for Python 2.7 (here) and install it

    Now to the proper interpreter. Go to Eclipse->Settings->PyDev->Interpreter - Python and there create a New... interpreter. The one that worked for me is found in /Library/Frameworks/Python.framework/Versions/2.7/bin. There just select the python alias which will link to the correct one then.

    Now make sure that your pygame is in your PYTHONPATH. To do so just add a New Folder in the lower half of the current menu and navigate to your pygame path (by default it is /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages)

提交回复
热议问题