You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/hpc/06_tools_and_software/04_python_packages_with_virtual_environments.mdx
+15-31Lines changed: 15 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,58 +30,42 @@ Thus you can consider the following options:
30
30
:::
31
31
::::
32
32
33
-
Thus you can consider the following options
34
-
35
-
- Reinstall your packages if some of the files get deleted
36
-
- You can do this manually
37
-
- You can also do this automatically. For example, within a workflow of pipeline software like [Nextflow](https://www.nextflow.io/)
38
-
- Pay for "Research Project Space" - see details on the [Research Project Space](../03_storage/05_research_project_space.mdx) page.
39
-
- Use Singularity and install packages within a corresponding overlay file - See instructions on our [Singularity with Conda](../07_containers/03_singularity_with_conda.md) page.
40
-
41
33
## Create virtual environment
42
-
It is advisable to create private environment inside the project directory. This boosts reproducibility and does not use space in `/home/$USER`
43
-
44
-
### virtualenv
45
-
[virtualenv](https://virtualenv.pypa.io/en/latest/) is a tool to create isolated Python environments
46
-
47
-
Since Python 3.3, a subset of it has been integrated into the standard library under the venv module.
48
-
49
-
You can create new virtual environment in two ways:
50
-
51
-
- empty
52
-
- inherit all packages from those installed on HPC already (and available in PATH after you load python module)
53
-
34
+
It is advisable to create private environment inside the project directory. This boosts reproducibility and does not use space in `/home/$USER`:
54
35
```sh
55
36
## created directory for your project and cd there
56
37
mkdir /scratch/$USER/my_project
57
38
cd /scratch/$USER/my_project
39
+
```
58
40
41
+
### `virtualenv`
42
+
[`virtualenv`](https://virtualenv.pypa.io/en/latest/) is a tool to create isolated Python environments. Since Python 3.3, a subset of it has been integrated into the standard library under the venv module. You can create new virtual environment in two ways:
43
+
- empty
44
+
```sh
59
45
## Create an EMPTY virtual environment
60
46
virtualenv venv
61
-
47
+
```
48
+
- inherit all packages from those installed on HPC already (and available in PATH after you load python module)
49
+
```sh
62
50
## Create an virtual environment that inherits system packages
63
51
virtualenv venv --system-site-packages
64
52
```
65
53
66
-
### venv
67
-
[venv](https://docs.python.org/3/library/venv.html) is package shipped with Python. It provides subset of options available in virtualenv tool ([link](https://virtualenv.pypa.io/en/latest/)).
54
+
### `venv`
55
+
[`venv`](https://docs.python.org/3/library/venv.html) is package shipped with Python. It provides subset of options available in virtualenv tool ([link](https://virtualenv.pypa.io/en/latest/)).
68
56
```sh
69
57
python -m venv venv
70
58
```
71
59
72
-
Create new virtual environment in current directory
73
-
60
+
Create new virtual environment in current directory:
74
61
- empty
75
-
- inherit all packages from those installed on HPC already (and available in PATH after you load python module)
76
62
```sh
77
-
## created directory for your project and cd there
78
-
mkdir /scratch/$USER/my_project
79
-
cd /scratch/$USER/my_project
80
-
##EMPTY
81
63
## (use venv command to create environment called "venv")
82
64
83
65
python -m venv venv
84
-
66
+
```
67
+
- inherit all packages from those installed on HPC already (and available in PATH after you load python module)
Copy file name to clipboardExpand all lines: docs/hpc/06_tools_and_software/06_conda_environments.mdx
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,10 @@
1
1
# Conda Environments (Python, R)
2
2
3
+
:::tip
4
+
This page describes how you can create conda environments without containers in `$SCRATCH`/`/home/$USER`. We strongly encourage you to create conda enviroments within Overlay files attached to Apptainer containers [as decribed in this section](../07_containers/03_singularity_with_conda.md). Please note that creating both kinds of conda environments is strongly discouraged as it leads to packages from one environment being accidentally used in another.
5
+
:::
6
+
7
+
3
8
## What is Conda?
4
9
Package, dependency and environment management for any language—Python, R, Ruby, Lua, Scala, Java, JavaScript, C/ C++, FORTRAN, and more. Please find more information at [the official documentation page](https://docs.conda.io/en/latest/)
0 commit comments