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 11:51] – 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 | ||
| | ||
conda update conda (update just the conda package) | conda update conda (update just the conda package) | ||
conda update --all (update all conda packages) | conda update --all (update all conda packages) | ||
+ | python3 -m pip list --outdated | ||
+ | python3 -m pip install --upgrade < | ||
| | ||
conda install conda=23.3.1 (installing or force-installing a specific conda package version) | conda install conda=23.3.1 (installing or force-installing a specific conda package version) | ||
Line 42: | Line 49: | ||
| | ||
conda remove --name myenv --all (remove a conda environment) | conda remove --name myenv --all (remove a conda environment) | ||
+ | |||
+ | __Running a cron under conda (is this correct?)__ | ||
+ | 21 15 * * * conda activate testenv2; / | ||
Questions/ | Questions/ | ||
* Create a conda test env with specific version of python | * Create a conda test env with specific version of python | ||
* Run a script using that new test environment | * Run a script using that new test environment | ||
+ | * Update the first line to point to the correct version of python | ||
+ | * 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 (?) | ||
- | __Setting | + | __Using venv to set up a python virtual environment__ |
<color # | <color # |
python_virtual_environments.1682697097.txt.gz · Last modified: 2023/04/28 11:51 by juckins