python

Versions

A list of versions currently installed on Whatbox servers can be found on the software labs page for your server.

Installing Scripts and Modules

Most Python scripts and modules are installable by using a python install command with the included setup.py file or using the pip Python package manager. By default, these methods install packages system-wide, which is not possible with your Whatbox slot. There are, however, a few methods of doing this.

User site

pip is the defacto standard Python package manager. This is generally the least complicated method to use but can cause issues if different scripts/modules require different versions of the same dependency. pip does not come pre-installed on your Whatbox slot, but it can be installed into your user site directory (~/.local).

Install pip for the version of Python you want. This installs pip into ~/.local/bin.

Add the user site bin directory to your PATH (if you've done this previously, you do not need to do it again).

echo "PATH=\$HOME/.local/bin:\$PATH" >> ~/.bashrc && source ~/.bashrc

Now you can install Python packages to your local library using the --user argument to pip install <package_name> like so: pip install --user <package_name>.

virtualenv

virtualenv is a tool to create isolated Python environments to address problems with dependencies, versions, and permissions between different modules and scripts. virtualenv can be compiled from source or installed using a user site installation of pip as shown above. With your virtualenv activated, you can use the pip install <package_name> command to install scripts and modules into that virtualenv.

More information about installing and using virtualenv can be found on its dedicated wiki page.

pipsi

pipsi is a wrapper around virtualenv and pip that installs scripts (not modules). It installs packages into separate virtualenvs inside your user site directory (~/.local) and then symlinks scripts from those packages to your user site bin directory.

Install pip into your user site directory using the User site instructions above.