Ubuntu – Installing Python modules on Ubuntu

12.04modulespythonpython3

I have been using Python on Windows for a while, so I'm into a lot of modules, including Pygame and LiveWires, but how do I install them into Ubuntu?

I have the py file for LiveWires, which has been specially edited (from a book I'm reading). I want to install it, but I'm not sure how to. I also want to install Pygame, but I can't.

Best Answer

In Ubuntu, you can list the packages available with the command

apt-cache pkgnames

but its output is huge, so pipe it to grep and search for what you want, (and then pipe to sort doesn't hurt either).

apt-cache pkgnames | grep py | sort

From this, looks like you want the python-pygame package, so install it with:

sudo apt-get install python-pygame