How to install pygame and livewires in ubuntu 14.04
Solution 1
Open a terminal and type the following commands. It will install pygame
on your system:
sudo apt-get install mercurial python3-pip libfreetype6-dev
sudo apt-get build-dep python-pygame
sudo pip3 install hg+http://bitbucket.org/pygame/pygame
Regarding livewires
, it seems that this package is for python2.x only as I got the following error when running sudo pip3 install livewires
:
Running setup.py install for livewires
File "/usr/local/lib/python3.4/dist-packages/livewires/beginners.py", line 201
raise ExBadParameters, "colour must be from Colour class"
^
SyntaxError: invalid syntax
File "/usr/local/lib/python3.4/dist-packages/livewires/boards.py", line 239
if k <> l and k <> -l:
^
SyntaxError: invalid syntax
File "/usr/local/lib/python3.4/dist-packages/livewires/games.py", line 110
raise GamesError, "Cannot have more than on Screen object"
^
SyntaxError: invalid syntax
Such errors are quite frequent when you want to run python2 code with a python3 interpreter.
Update: it seems possible to run 2to3 on the above files and successfully install livewires
.
- Download and extract LiveWires-2.1.tar.gz from pypi.
cd LiveWires-2.1
2to3 -w livewires/*
sudo python3 setup.py install
Solution 2
There is an Ubuntu package python-pygame
. You can install it using the graphical application Software or on command line by
sudo apt-get install python-pygame
Related videos on Youtube
Everything123 Channel
I am just some random shitty coder trying to improve. Teach me daddy!
Updated on September 18, 2022Comments
-
Everything123 Channel over 1 year
This thread is not only about pygame but also about livewires. I followed the first answer on this link but when i write this command :
sudo pip install pygame
, I get an error saying:Could not find any downloads that satisfy the requirement pygame. Some externally hosted files were ignored (use --allow-external pygame to allow). Cleaning up... No distributions at all found for pygame Storing debug log for failure in /home/cooldudeabhi/.pip/pip.log
How to fix them. Also, I am using python 3.4. Please help me to install both modules: Pygame as well as livewires.
-
muru about 9 yearsIf your using python3, you should be using
pip3
instead ofpip
.
-
-
muru about 9 yearsIt's for Python2 only.
-
Everything123 Channel about 9 yearsI am using livewires with python 3.1 on my windows machine
-
Sylvain Pineau about 9 years@androidplusios.design: version 2.1 from pypi? please post your installation steps as a new answer if possible
-
Everything123 Channel about 9 yearsFor windows machine?
-
Sylvain Pineau about 9 years@androidplusios.design: Probably not ;). But I’m still curious about the python3.x compatibility.
-
Everything123 Channel about 9 yearsDownload the complete pack from here...instruction inside of the files. bit.ly/1wmJ3mA
-
Sylvain Pineau about 9 years@androidplusios.design: Thanks for the link. The livewires version is 1.7 according to the games.py header.