Seite 1 von 1

Pygame mit Python 3.6.x

Verfasst: Donnerstag 29. Juni 2017, 18:34
von Cytzix
Hey Leute,

läuft eigentlich Pygame auch mit Python 3 oder nur unter Python 2?
Ich habe beide Versionen auf meinem Mac und kriege es mit Python 2 ohne Probleme zum laufen, jedoch mit Python 3 scheint es Probleme zu geben. Ich kriege dann folgenden Error:

Traceback (most recent call last):
File "/Users/hoffmannv/Desktop/slither.py", line 1, in <module>
import pygame, time, random
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pygame/__init__.py", line 133, in <module>
from pygame.base import *
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pygame/base.so, 2): Symbol not found: _PyCObject_Type
Referenced from: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pygame/base.so
Expected in: flat namespace
in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pygame/base.so

Re: Pygame mit Python 3.6.x

Verfasst: Freitag 30. Juni 2017, 11:44
von Astorek
https://www.pygame.org/wiki/GettingStar ... stallation
For Python3 on mac, there are some known issues with pip installation. If it doesn't work for you, please see the /wiki/MacCompile instructions.
https://www.pygame.org/wiki/MacCompile

Mehr kann ich mangels Mac nicht sagen (und ich gehe davon aus, dass du es gemäß Anleitung installiert hast?)...

Re: Pygame mit Python 3.6.x

Verfasst: Montag 3. Juli 2017, 15:24
von PJanow4711
Es kann sein dass er einige Libary's nur für Python2 installiert sind. Die Libary's unterscheiden sich zwischen Python 2 und Python 3 und können deshalb nicht von beiden Versionen benutzt werden.

Bei mir hat es funktioniert nachdem ich einige zusätzliche Libary's mit pip3 installiert habe.