Quick dependency install commands for Ubuntu
You can save tons of time getting other people's games to run if you have the dependencies installed already. Here are Ubuntu commands I used to install a bunch of libraries that might show up in PyWeek:
sudo apt install python python3 python-dev python-pip python-setuptools swig g++ \ python-pygame python-pyglet libgl1-mesa-dev libglu1-mesa-dev python-opengl \ python-pyode python-renpy libblas-dev liblapack-dev gfortran pypy python-pil \ python-yaml python-future python3-future sudo easy_install -U distribute pip install --user pymunk cocos2d beautifulsoup rabbyt panda euclid scipy mingus cython \ kivy pysld2-cffi fysom Pillow
The following are libraries that require the --pre option on pip because of their nonstandard version numbers. Install with care:
pip install --pre --user box2d lepton
You can install pygame for python3 from an unofficial ppa by first becoming root (sudo su -) and then doing the following:
export UBUNTU_VERSION=`lsb_release -cs` echo deb http://ppa.launchpad.net/thopiekar/pygame/ubuntu $UBUNTU_VERSION main >> /etc/apt/sources.list echo deb-src http://ppa.launchpad.net/thopiekar/pygame/ubuntu $UBUNTU_VERSION main >> /etc/apt/sources.list apt update apt install python3-pygame
The following libraries were on this list at one point, but I can't figure out how to install them anymore. They may be obsolete: pgu, ctypes, libavbin-dev
Do you know of a library not on the list? Tell me its name in pip or whatever and I'll add it.
(log in to comment)
Comments
reidrac: good advice! ship the library version you know works!
virtualenv ENV
source ENV/bin/activate
pip install pip --upgrade
And then pip install whatever I need. Upgrading pip is very important because otherwise you may use an outdated version (may be buggy) that was packaged by your Linux distro, and in my experience using the latest pip is always better.
Finally I never install system-wide with pip because from the point of view of maintainability of the system is not a good idea (may cause problems/conflicts when installing packages with the distro package manater, or upgrading the system to a newer version).
When you're done you can close that terminal session or use "deactivate" to leave the virtualenv.
This is how I do it, and it doesn't mean is "the best way" :)
apt-get install virtualenvwrapper
echo . /usr/local/bin/virtualenvwrapper.sh >>~/.bashrc
source ~/.bashrc
Then you can create a virtualenv with 'mkvirtualenv' and switch to an existing virtualenv with 'workon'. Check out the docs. You won't look back, promise.
I can definitely see it being crucial in a lot of situations. I can't imagine what a pain it would be if you needed two different versions of a library without using virtualenv.
Right, I don't really have projects with significant dependencies. (For python games I pretty much just use pygame.)
pip install packages into the user's python package directory:
With Python 2.6 came the “user scheme” for installation, which means that all Python distributions support an alternative install location that is specific to a user. The default location for each OS is explained in the python documentation for the site.USER_BASE variable. This mode of installation can be turned on by specifying the –user option to pip install.
The --user option to pip must have been added recently. It makes With Python 2.6 came the “user scheme” for installation, which means that all Python distributions support an alternative install location that is specific to a user. The default location for each OS is explained in the python documentation for the site.USER_BASE variable. This mode of installation can be turned on by specifying the –user option to pip install.
PyTM30 on 2013/04/08 21:52:
python-pyglet will probably give you version 1.1.4 some people (myself included, although I might be using the latest from the mercurial repo and I'll package it with the game) may be using 1.2alpha1 which is available from PyPI.