Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 14788  / 2 Years ago, wed, july 27, 2022, 3:42:07

There is a package (python-pygame) for Python2 available from the universe repository. However, I want to work through the tutorial in the Invent with Python book. Going through SPM (Synaptic), I cannot find a pygame resource for Python3.



Also, I looked on the Pygame website and it is not clear if Pygame is available for Python3 (though the book indicates that it is).



Can someone help me with my dilemma?


More From » 11.10

 Answers
1



Thanks to Sergey's suggestion, this is how to get it working:
INSTALL
(1) Move to a directory where you want the source code to be downloaded to
(2) svn co svn://seul.org/svn/pygame/trunk pygame
NOTE: Be sure to use the svn method. Simply downloading the pygame*.tar.gz
file from the pygame downloads page didn't work!
(3) cd pygame
(4) python3 config.py
NOTE: This confirms that you have the dependencies.
(5) python3 setup.py build
(6) sudo python3 setup.py install
NOTE: On my machine, I have the distro's python3.2 installed (which is in
the /usr/lib directory). This step places the pygame module into
/usr/local/lib -- which is what you want (per Sergey's suggestion).

TEST
(1) python3
(2) At the '>>>' prompt, type "import pygame"
VALIDATION: If you get another '>>>' prompt, all is well.



per BlaXpirit, you may also choose to use hg instead of svn:



hg clone https://bitbucket.org/pygame/pygame



[#40807] Thursday, July 28, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
eatack

Total Points: 245
Total Questions: 120
Total Answers: 113

Location: Estonia
Member since Wed, Jun 8, 2022
2 Years ago
;