Python Workbench
Description
This workspace types comes with various Python development tools already installed:
uvfor installing different python versions and dependencies lightning fastpyenvfor managing different python versionsminicondafor managing dependency environmentspoetryfor an alternative way of running projects with specified dependencies
There are various flavours of this Catalog Item:
- Python Workbench CLI (login via command line)
- Python Workbench Desktop (login via desktop)
Simply choose the one that is most convenient to you.
Creation
Create a storage volume
If desired, first create a storage volume before creating the workspace.
See the Getting started page for more info about how and why to create a storage volume.
Create a workspace
In the Research Cloud portal click the ‘Create a new workspace’ button and follow the steps in the wizzard.
See the workspace creation manual page for more guidance.
Access
Python Workbench CLI
For the Python Workbench CLI (command line) flavour of this Catalog Item, you can login using SSH.
Python Workbench Desktop
For the Python Workbench Desktop flavour of this Catalog Item, you can login using your browser. It is also possible to login via SSH, as described above.
Usage
The first time (but only the first time) you login to a workspace of this type, the Python tools (pyenv, miniconda and poetry) are installed for your user. This means that at first login you may experience a small delay (~1 minute maximum). During this time, if you are logging in on the command line, you will see that the applications are being installed for you:
--- Running install scripts at first login: executing /home/username/runonce.d/01_pyenv-install.sh
--- Running install scripts at first login: executing /home/username/runonce.d/10-poetry.sh
--- Running install scripts at first login: executing /home/username/runonce.d/runonce_conda.sh
When you are logged in you can start developing or running code. On the command line, you will have uv, pyenv, miniconda, and poetry available.
Python environments
You can use uv(recommended) or pyenv to install and select a different (newer) Python version, and create virtual environments.
uv
In your project folder, create a virtual environment with a specific Python version (e.g. 3.12): uv venv --python 3.12 See the uv docs or tutorials to learn more.
pyenv
In your project folder, create a virtual environment with a specific Python version (e.g. 3.12): pyenv virtualenv 3.12 myprojectenv
See the pyenv docs.
conda
To start using miniconda environments, use the conda command. You will be able to create two different kinds of environments:
- shared environments, available for all users. These can exist in two locations:
/opt/miniconda/envs/usr/local/uu/env/conda
- personal environments, stored in your home directory and accessible only to you (and workspace admin users, if any).
To see all available environments, including shared environments, run conda env list.
To create a shared environment, run conda create -p /opt/miniconda/envs/myenvname (add other arguments to the command as you want).
To create a personal conda environment in your home directory, run conda create -n myenvname.
Note on licensing: conda packages exist in different ‘channels’. As of 2024, the default conda channels are no longer free for use by large organizations (although certain educational exceptions exist). For this reason, UU workspaces have disabled the default channels by default. Instead, we set the fully open-source conda-forge channel as default. If you want (and believe you are allowed) to use the default conda channels, you can override the used channels by explicitly adding defaults to your environment.yml under the channels: key.
See the miniconda docs for futher explanation of usage.
poetry
See the poetry docs.
Note that when you create a python environment using any of the tools above, you create a python environment for yourself only and not for others in your Collaboration. If you collaborate, you colleague should creaate their own python environment. We recommend collaborating using GitHub and uv (using a uv.lock file) to make sure your environments are the same. If this is not desired, create the environments in a shared location, like /local-share.
Data transfer options
See our data transfer manuals.
The recommended iBridges client for Yoda and iRODS is preinstalled.
VSCodium code editor (Desktop only)
Under ‘Applications’ (topleft corner) you can find the code editor ‘VSCodium’ (an open source alternative to VS Code) under ‘Development’. VSCodium can be used for writing python scripts, Jupyter Notebooks, etc.
Jupyter lab interface (Desktop only)
Note that VSCodium has a Jupyter extension to work with notebooks. If you however prefer a Juypter Lab interface, open a terminal and use the following commands to install Jupyter:
cd <your project folder>
uv venv --python 3.12
source .venv/bin/activate
uv pip install jupyter
And jupyter lab to launch it.
Installing additional software
The user has admin rights to install additional software on the system from the terminal.
Tips
Workspace security
Please take a moment to read the security recommendations for VREs.