Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
hpc-compendium
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ZIH
hpcsupport
hpc-compendium
Commits
edf166a8
Commit
edf166a8
authored
1 year ago
by
Guilherme Calandrini
Browse files
Options
Downloads
Patches
Plain Diff
fixes example python_virtual_environment
parent
41b9c1a5
No related branches found
No related tags found
2 merge requests
!990
Automated merge from preview to main
,
!989
fixes example python_virtual_environment
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc.zih.tu-dresden.de/docs/software/python_virtual_environments.md
+24
-11
24 additions, 11 deletions
...u-dresden.de/docs/software/python_virtual_environments.md
with
24 additions
and
11 deletions
doc.zih.tu-dresden.de/docs/software/python_virtual_environments.md
+
24
−
11
View file @
edf166a8
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment