UCL Department of Electronic and Electrical Engineering
Staff/Student Intranet

Python/Conda Package Management

useful commands to copy/clone environments
If you need to migrate an old envrionment to run on a recently upgraded server, you need to create the package list on cork.ee.ucl.ac.uk and do the rest on one of the upgraded GPU servers.


Activate your virtual env and then use the following command to create a list of all packages in your virtual env

pip freeze > requirements.txt

Deactivate your old virtual env and create a new default virtual env. Activate that env and the use the following command to install the same requirements into your new virtualenv :

pip install -r requirements.txt


If you are using Anaconda, activate your env and then generate a package list with:

conda list -e > requirements.txt

Dectivate your old env, create a new Anaconda env and then activate it. You can install the packages with:

conda install --file requirements.txt

Anaconda will also allow you to directly clone an env into a new one:

conda create --name new_env --clone original_env