Skip to content
Snippets Groups Projects
Commit edf166a8 authored by Guilherme Calandrini's avatar Guilherme Calandrini
Browse files

fixes example python_virtual_environment

parent 41b9c1a5
No related branches found
No related tags found
2 merge requests!990Automated merge from preview to main,!989fixes example python_virtual_environment
...@@ -37,24 +37,37 @@ environment (using the module system). ...@@ -37,24 +37,37 @@ environment (using the module system).
At first, we check available Python modules and load the preferred version: At first, we check available Python modules and load the preferred version:
```console ```console
marie@compute$ module avail Python #Check the available modules with Python [marie@login.barnard ~]$ module load release/23.10 GCCcore/11.3.0
[...] Module GCCcore/11.3.0 loaded.
marie@compute$ module load Python #Load default Python [marie@login.barnard ~]$ module avail Python # check available Python modules
Module Python/3.7 2-GCCcore-8.2.0 with 10 dependencies loaded
marie@compute$ which python #Check which python are you using ---------------------------- Software build with Compiler GCCcore version 11.3.0 (HMNS Level Two) -----------------------------
/sw/installed/Python/3.7.2-GCCcore-8.2.0/bin/python flatbuffers-python/2.0 pkgconfig/1.5.5-python protobuf-python/4.21.9 (D) Python/3.10.4-bare
IPython/8.5.0 protobuf-python/3.19.4 Python/2.7.18-bare Python/3.10.4 (D)
Where:
D: Default Module
*Module: Some Toolchain, load to access other modules that depend on it
>Module: Recommended toolchain version, load to access other modules that depend on it
[marie@login.barnard ~]$ module load Python # load default Python
Module Python/3.10.4 and 11 dependencies loaded.
[marie@login.barnard ~]$ which python # check with version you are Python version you are using
/software/rapids/r23.10/Python/3.10.4-GCCcore-11.3.0/bin/python
``` ```
Then create the virtual environment and activate it. Then create the virtual environment and activate it.
```console ```console
marie@compute$ ws_allocate python_virtual_environment 1 [marie@login.barnard ~]$ ws_allocate python_virtual_environment 1
Info: creating workspace. Info: creating workspace.
/data/horse/ws/marie-python_virtual_environment /data/horse/ws/marie-python_virtual_environment
[...] remaining extensions : 10
marie@compute$ virtualenv --system-site-packages /data/horse/ws/marie-python_virtual_environment/env #Create virtual environment remaining time in days: 1
[...] [marie@login.barnard ~]$ python3 -m venv --system-site-package /data/horse/ws/marie-python_virtual_environment # create a Python virtual environment
marie@compute$ source /data/horse/ws/marie-python_virtual_environment/env/bin/activate #Activate virtual environment. Example output: (env) bash-4.2$ [marie@login.barnard ~]$ source /data/horse/ws/marie-python_virtual_environment/bin/activate
(marie-python_virtual_environment) [marie@login.barnard ~]$ python --version
Python 3.10.4
``` ```
Now you can work in this isolated environment, without interfering with other Now you can work in this isolated environment, without interfering with other
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment