18 January 2024

This tutorial describes how to setup virtualenv on eceubuntu. If your are installing it in another environment, skip up to Creating virtualenv step.

ECE Ubuntu Machines

To login to these machines use eceubuntu.uwaterloo.ca. When working remotely, first login to eceterm.uwaterloo.ca or eceterm.uwaterloo.ca and then to one of the machines above. For example

$ ssh user@eceterm.uwaterloo.ca
$ ssh user@eceubuntu.uwaterloo.ca

To simplify this, you can use ssh ProxyJump feature. For example, follow this tutorial.

Create virtualenv space for the course

Detailed instructions are available at https://docs.python.org/3/library/venv.html.

$ mkdir ece650
$ cd ece650
$ python3 -m venv venv

Activate virtualenv (this needs to be done at every login to use the environment)

$ source ./venv/bin/activate
(venv) [user@eceubuntu ece650]$

Install required packages

You might find it convenient to use the coverage package to evaluate the quality of your testing.

$ source ./venv/bin/activate
$ pip install coverage

To de-active the environment

(venv) [user@eceubuntu ece650]$ deactivate

To activate and deactivate virtualenv during each login session

$ source ./venv/bin/activate
(venv) $ coverage --help
(venv) $ deactivate
$

After virtualenv is activated you should be able to use python, coverage, ipython, and other python commands as usual.