Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
doku:python [2024/02/29 09:25] katrindoku:python [2024/09/18 11:14] (current) katrin
Line 1: Line 1:
-====== Python in VSC ======+====== Python / Conda at VSC ======
  
-Previously we recommended using spack python packages, however we decided to deprecate this approach since it is much easier and user friendly to use '''conda''' which is already widely known. +Previously we recommended using spack python packages, however we decided to **deprecate** this approach since it is much easier and user friendly to use '''conda''' which is already widely known. 
  
 Have a look at the new **quickstart guide** below or the material from the python4hpc training: [[https://gitlab.tuwien.ac.at/vsc-public/training/python4hpc|python4hpc public repo]]. Have a look at the new **quickstart guide** below or the material from the python4hpc training: [[https://gitlab.tuwien.ac.at/vsc-public/training/python4hpc|python4hpc public repo]].
Line 20: Line 20:
 channels: channels:
   - conda-forge   - conda-forge
-  - defaults 
 dependencies: dependencies:
   - python=3.10   - python=3.10
Line 38: Line 37:
 # create your environment via environment file # create your environment via environment file
 # this will place the environment in your ~/.conda/envs folder # this will place the environment in your ~/.conda/envs folder
-# note: make sure to use "conda >env< create" - "conda create" is a different command +# note:  
-(base) $ conda env create -n my-env --file my_env.yaml+#  - make sure to use "conda >env< create" - "conda create" is a different command 
 +#  - the name is taken from the yaml file; a custom name can be specified with "-n my-custom-name"  
 +(base) $ conda env create --file my_env.yaml
  
 # after creation you can activate the environment to run code in it # after creation you can activate the environment to run code in it
-(base) $ conda activate my-env+(base) $ conda activate my_env
  
 # test python version to make sure we have the right one # test python version to make sure we have the right one
-(my-env) $ python --version+(my_env) $ python --version
 Python 3.10.11 Python 3.10.11
 </code> </code>
Line 94: Line 95:
   - pytorch   - pytorch
   - conda-forge   - conda-forge
-  - defaults 
 dependencies: dependencies:
   - python=3.12   - python=3.12
Line 165: Line 165:
 ==== Channels ==== ==== Channels ====
  
-The ''default'' conda channel points to anacondas repository. However this repo does not always contain the latest packages. There are a number of community driven channels (e.g. ''conda-forge'') that have many more packages and most of the time the newer versions readily available.+The ''defaults'' conda channel points to anacondas repository which **requires licensing (since 2024)** and does not always contain the latest packages. There are a number of community driven channels (e.g. ''conda-forge'') that have many more packages and most of the time the newer versions readily available.
  
 Popular channels Popular channels
Line 175: Line 175:
 If you want to set e.g. ''conda-forge'' as default for your user you can achieve this by executing the following statement: If you want to set e.g. ''conda-forge'' as default for your user you can achieve this by executing the following statement:
 <code bash> <code bash>
 +conda config –remove channels defaults
 conda config --add channels conda-forge conda config --add channels conda-forge
 </code> </code>
  • doku/python.1709198748.txt.gz
  • Last modified: 2024/02/29 09:25
  • by katrin