Answer the question
In order to leave comments, you need to log in
How to install pygame_sdl2 for python3 if there are multiple versions of python on the system?
I have ubuntu 16.04 with a cinnamon shell that pulls in python 2.7 on install. Additionally, python 3.6 was installed for development
. Installation of pygame_sdl2 was required, but here's the catch - it sudo apt install python-pygame-sdl2
installs the library for 2.7, but it is necessary for 3.6
Share your experience in solving the issue. I'm sure I'm not the first one to come across
Answer the question
In order to leave comments, you need to log in
To get started, try following the official documentation :
Ubuntu:sudo apt-get install build-essential python-dev libsdl2-dev \ libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev \ libjpeg-dev libpng12-dev virtualenvwrapper
Open a new shell to ensure virtualenvwrapper is running, then run:mkvirtualenv pygame_sdl2 pip install cython
Change into a clone of this project, and run the following command to modify the virtualenv so pygame_sdl2 header files can be installed in it:
Finally, build and install pygame_sdl2 by running:
If the library will not be available for import in Python3, try replacing the callspython
topython3
andpip
to in the instructions abovepip3
. And try again.
There is also a suspicion that the instructions are missing:git clone https://github.com/renpy/pygame_sdl2
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question