Skip to content
Snippets Groups Projects

Resolve "Update documentation on virtual env. for Alpha"

Merged Elias Werner requested to merge 533-update-documentation-on-virtual-env-for-alpha into preview
All threads resolved!
1 file
+ 15
4
Compare changes
  • Side-by-side
  • Inline
@@ -128,11 +128,22 @@ marie@login.alpha$ module spider <module_name>
additional Python packages and create an isolated runtime environment. We recommend using
`virtualenv` for this purpose.
!!! hint
We recommend to use [workspaces](../data_lifecycle/workspaces.md) for your
virtual environments.
??? example "Example: Creating virtual environment and installing `torchvision` package"
```console
marie@login.alpha$ srun --nodes=1 --cpus-per-task=1 --gres=gpu:1 --time=01:00:00 --pty bash -l
marie@alpha$ mkdir python-environments # please use workspaces
marie@alpha$ ws_allocate python_virtual_environment 1
Info: creating workspace.
/beegfs/ws/1/marie-python_virtual_environment
remaining extensions : 2
remaining time in days: 1
marie@alpha$ module load release/23.04 GCCcore/11.3.0 GCC/11.3.0 OpenMPI/4.1.4 Python/3.10.4
Module GCC/11.3.0, OpenMPI/4.1.4, Python/3.10.4 and 21 dependencies loaded.
marie@alpha$ module load PyTorch/1.12.1-CUDA-11.7.0
@@ -141,13 +152,13 @@ additional Python packages and create an isolated runtime environment. We recomm
/software/rome/r23.04/Python/3.10.4-GCCcore-11.3.0/bin/python
marie@alpha$ pip list
[...]
marie@alpha$ virtualenv --system-site-packages python-environments/my-torch-env
marie@alpha$ virtualenv --system-site-packages /beegfs/ws/1/marie-python_virtual_environment/my-torch-env
created virtual environment CPython3.8.6.final.0-64 in 42960ms
creator CPython3Posix(dest=~/python-environments/my-torch-env, clear=False, global=True)
creator CPython3Posix(dest=/beegfs/.global1/ws/marie-python_virtual_environment/my-torch-env, clear=False, global=True)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=~/.local/share/virtualenv)
added seed packages: pip==21.1.3, setuptools==57.2.0, wheel==0.36.2
activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
marie@alpha$ source python-environments/my-torch-env/bin/activate
marie@alpha$ source /beegfs/ws/1/marie-python_virtual_environment/my-torch-env/bin/activate
(my-torch-env) marie@alpha$ pip install torchvision==0.13.1
[...]
Installing collected packages: torchvision
Loading