python_virtual_environments
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| python_virtual_environments [2023/04/28 15:22] – juckins | python_virtual_environments [2023/08/10 11:35] (current) – juckins | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ==== Python Virtual Environments ==== | ==== Python Virtual Environments ==== | ||
| - | [[https:// | + | [[https:// |
| - | Crons under conda [[https:// | + | |
| __Installing miniconda__ | __Installing miniconda__ | ||
| Line 17: | Line 16: | ||
| * (Accept license agreement and all the suggested default choices) | * (Accept license agreement and all the suggested default choices) | ||
| + | * Note that if you do not want conda' | ||
| - | ~/ | + | |
| + | |||
| + | Now try creating a test conda environment: | ||
| + | |||
| + | cd ~/ | ||
| + | | ||
| ~/ | ~/ | ||
| Line 30: | Line 35: | ||
| conda deactivate | conda deactivate | ||
| | | ||
| - | Other useful commmands: | + | Other useful commmands |
| - | conda create -n testenv2 python=3.11.3 | + | conda create -n testenv2 python=3.11.3 |
| conda activate testenv2 | conda activate testenv2 | ||
| | | ||
| Line 45: | Line 50: | ||
| conda remove --name myenv --all (remove a conda environment) | conda remove --name myenv --all (remove a conda environment) | ||
| - | __Running a cron under conda__ | + | __Running a cron under conda (is this correct?)__ |
| - | 21 15 * * * conda activate testenv2; / | + | 21 15 * * * conda activate testenv2; / |
| Questions/ | Questions/ | ||
| Line 53: | Line 58: | ||
| * Update the first line to point to the correct version of python | * Update the first line to point to the correct version of python | ||
| * Run cron under conda | * Run cron under conda | ||
| + | * If you update the first line in the script to point to desired conda version of python, then no need to activate the conda env (?) | ||
| __Using venv to set up a python virtual environment__ | __Using venv to set up a python virtual environment__ | ||
python_virtual_environments.1682709771.txt.gz · Last modified: by juckins
