User Tools

Site Tools


other:uvcdat:cdat_conda:miniconda3_install

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
Next revision Both sides next revision
other:uvcdat:cdat_conda:miniconda3_install [2021/06/28 13:17]
jypeter [Using mamba instead of conda]
other:uvcdat:cdat_conda:miniconda3_install [2024/03/22 16:04]
jypeter [Using the installer] Updated for 2024-03 installation
Line 3: Line 3:
 ===== What? Why? ===== ===== What? Why? =====
  
-  * //​Miniconda3//​ is a minimal ​python environment/​distribution that can be used for creating more complete work environments. It will basically make the ''​conda''​ command available on your computer, and you can then use ''​conda''​ to install and update ​more python ​packages and their dependencies.+  * //​Miniconda3//​ is a minimal/bootstrap Python ​distribution that can be used for creating more complex Python distributions. It will basically make a recent ​''​conda''​ command available on your computer, and you can then use this ''​conda''​ to create independent Python distributions,​ where you can install and update ​Python ​packages and their dependencies.
  
-  * A python ​//​environment//​ is basically where you install ​python. A python //​distribution//​ is the collection of packages you have chosen to install together in the environment.+  * A conda //​environment//​ is basically where you install ​the Python that you will use (independently of //​Miniconda3//​ itself). A python //​distribution//​ is the collection of packages you have chosen to install together in this environment. 
 +    * Example: initializing an environment named ''​cdatm_py3''<​code>​ >which conda 
 +conda: ​  ​aliased to source /​path_to_miniconda/​etc/​profile.d/​conda.csh
  
-  * You don't need to be (and **you should not be**) //root// when you install Miniconda3. You just need enough disk space where you have write access+ > conda activate cdatm_py3
  
-  * If you are installing Miniconda3 in a Linux environment on a [[other:​win10wsl|Windows 10 computer using Windows Subsystem for Linux (WSL)]], pay special ​attention to the instructions on the **WSL** lines+(cdatm_py3> which python 
 +/​path_to_miniconda/​envs/​cdatm_py3/​bin/​python 
 +</​code>​ 
 +    * The special ​environment where //​miniconda//​ itself is installed is called ''​base''<​code> ​ > conda activate base
  
-  * The way you do things will depend on how you are going to use python. There may be some slight differences if you are installing the environment just for you, or if you need a more stable environment because you are installing for multiple users.+(base) > which python 
 +/​path_to_miniconda/​bin/​python 
 +</​code>​
  
-  * You could also start with the //​Anaconda//​ installer that will install a much more complete python environment,​ ready for use, but we choose not to do that because Anaconda requires more disk space at the beginning, and all its packages come from the ''​default''​ //channel// (or //​repository//​) provided by the [[https://​docs.conda.io/​projects/​conda/​en/​latest/​glossary.html#​conda-repository|conda repository]]. This is not very useful because we will be mostly using (the same) packages provided by the [[https://​conda-forge.org/​feedstock-outputs/​|conda-forge]] channel.+  ​* You don't need to be (and **you should not be**) //root// when you install Miniconda3. You just need enough disk space where you have write access 
 +    * **WARNING**:​ by default, miniconda will install itself and subsequent Python environments in a hidden sub-directory of your home (''​~/​.conda''​ on Linux). **Do not use the default installation location**, if you want to avoid disk space related problems (//disk full//, q//uota exceeded//, ...) 
 +    * Choose carefully where you will install miniconda, because the size of the installation directory will start at a few Gb and will keep on growing 
 + 
 +  * If you are installing Miniconda3 in a Linux environment on a [[other:​win10wsl|Windows 10 computer using Windows Subsystem for Linux (WSL)]], pay special attention to the specific instructions on the **WSL** lines 
 + 
 +  ​* You could also start with the full //​Anaconda//​ installer that will install a much more complete python environment,​ ready for use. We choose not to do that because Anaconda requires more disk space at the beginning, and all its packages come from the ''​default''​ //channel// (or //​repository//​) provided by the [[https://​docs.conda.io/​projects/​conda/​en/​latest/​glossary.html#​conda-repository|conda repository]]. This is not very useful because we will be mostly using (the same) packages provided by the [[https://​conda-forge.org/​feedstock-outputs/​|conda-forge]] ​//channel//.
  
 Note: some extra details are available on the much older page //​Installing and maintaining UV-CDAT with conda//. You can check later the [[other:​uvcdat:​conda_notes#​useful_conda_commands|Useful conda commands]], but the [[https://​docs.conda.io/​projects/​conda/​en/​latest/​index.html|official conda documentation]] and the [[https://​docs.conda.io/​projects/​conda/​en/​latest/​user-guide/​cheatsheet.html|Cheat sheet]] are probably more up-to-date. Note: some extra details are available on the much older page //​Installing and maintaining UV-CDAT with conda//. You can check later the [[other:​uvcdat:​conda_notes#​useful_conda_commands|Useful conda commands]], but the [[https://​docs.conda.io/​projects/​conda/​en/​latest/​index.html|official conda documentation]] and the [[https://​docs.conda.io/​projects/​conda/​en/​latest/​user-guide/​cheatsheet.html|Cheat sheet]] are probably more up-to-date.
Line 27: Line 40:
  
  
-  ​Get the [[https://repo.anaconda.com/​miniconda/​Miniconda3-latest-Linux-x86_64.sh|Python 3.8 Linux 64-bit ​(bash installer)]] (unless there is a [[https://conda.io/miniconda.html|more recent version?]]) +==== Downloading the installer ==== 
-    * Find some temporary space on Linux (or Windows, if you are using [[other:​win10wsl|WSL]]) + 
-      * e.g. Linux at LSCE:\\ ''​cd /​home/​scratch01/​<​your_login>​''​ +  ​We will work with a download link that always point to the [[https://docs.anaconda.com/free/miniconda/#latest-miniconda-installer-links|latest version of the installer]] 
-      * e.g. WSL, assuming that there is a ''​C:​\Scratch\<​your_login>''​ directory:​\\ ''​cd /​mnt/​c/​Scratch/<​your_login>''​ +    * For the Linux computers we commonly use, we need the //​Miniconda3 ​Linux 64-bit// link: https://repo.anaconda.com/miniconda/​Miniconda3-latest-Linux-x86_64.sh 
-    * Use ''​wget''​ to download the installer:​\\ ​''​wget https://​repo.anaconda.com/​miniconda/​Miniconda3-latest-Linux-x86_64.sh'' ​(90 Mb26 Feb 2021)+    ​* The installer is based on **Python 3.12 as of March 2024** 
 + 
 +  ​* Find some temporary space on Linux (or Windows, if you are using [[other:​win10wsl|WSL]]) 
 +    * e.g. Linux at LSCE:\\ ''​cd /​home/​scratch01/​$USER''​ 
 +    * e.g. Linux at spiritx:<​code>​$ mkdir /​homedata/​$USER/​Scratch 
 +$ cd /​homedata/​$USER/​Scratch 
 +</​code>​ 
 +    ​* e.g. WSL, assuming that there is a ''​C:​\Scratch\<​your_login>''​ directory:​\\ ''​cd /​mnt/​c/​Scratch/<​your_login>''​ 
 + 
 +  ​* Use ''​wget''​ to download the latest ​installer ​(138 Mb as of 22 Mar 2024):\\ <​code>​$ ​wget https://​repo.anaconda.com/​miniconda/​Miniconda3-latest-Linux-x86_64.sh 
 +$ ls -lh Miniconda3-latest-Linux-x86_64.sh 
 +[...] 138M Feb 27 20:40 Miniconda3-latest-Linux-x86_64.sh</​code>​ 
 + 
 +==== Using the installer ==== 
 + 
 +We assume below that we are in the [[#​downloading_the_installer|directory where we have downloaded the installer]] 
 + 
 +  * Determine the directory where you will install miniconda3 and all the Python environments based on this version of miniconda3, but **do not create the directory** ​(the installation script will do it) 
 +    * Remember that you will need a few Gb of available space 
 +    * At LSCEdo not install in a subdirectory of your home directory! 
 +    * We add some date or version information at the end of the directory, in order to differentiate it from other (older of futureinstallations 
 +    * e.g. Linux at LSCE: ''/​home/​share/​unix_files/​cdat/​miniconda3_2024-03''​ 
 +    * e.g. Linux at spiritx: ''/​homedata/​$USER/​miniconda3_2024-03''​ 
 +    * e.g. WSL FIXME
  
-  * Execute the installer +  * Execute the installer ​with ''​bash Miniconda3-latest-Linux-x86_64.sh''​ 
-    * ''​bash Miniconda3-latest-Linux-x86_64.sh''​ +    Review ​the license ​(type ''<​SPACE>''​ several times...) and accept it 
-      Accept ​the license +    When asked for the installation ​directory, use the directory name chosen aboveand **not the default directory** 
-      Note: at the end of the installation,​ **answer //no// to the following question**, so that the installer does **not** change your existing shell configuration files!\\ ​''​Do you wish the installer ​to initialize ​Miniconda3 by running ​conda init[yes|no]'' ​=> **NO** +    ​* **Answer ''​no''​ to the question ​''​Do you wish to update your shell profile to automatically ​initialize conda?''​**. Otherwise the installation will make changes to your shell configuration files 
-      * Specify an explicit installation path **outside of your //home// directory**,​ with enough disk space (more than 3 Gb if you are going to install CDAT and some extra packages)preferably on a disk that is not backed up+      * If you forget ​to answer ''​no''​you can apparently
-        * Installations ​by //JYP//: +        * remove the changes to your shell configuration files by typing later: ''​conda init --reverse $SHELL''​ 
-          * Linux at LSCE: ''​/​home/​share/​unix_files/​cdat/​miniconda3<​possibly_some_version_here>/''​ +        * or at least disable the automatic activation ​of the environment (that might have side effect) by typing: ''​conda config --set auto_activate_base false''​ 
-          * Linux on ciclad: ''/​data/​jypmce/​cdat/​miniconda3<​possibly_some_version_here>/​''​ +      * The resulting ''​miniconda3''​ directory size is 647 Mb (as of March 2024)\\ <​code>​du -sh miniconda3_2024-03 
-        * WSL: installing outside ​of your ''/​home/​your_login/''​ directory <wrap hi>does not work</​wrap>​. You need to accept ​the installation in the default location: ''​/​home/<​your_login>/​miniconda3''​ +647M    miniconda3_2024-03
-      * The resulting ''​miniconda3''​ directory size is 342M\\ <​code> ​du -sh miniconda3 +
-342M    miniconda3+
  
- > ​cd miniconda3+cd miniconda3_2024-03
  
- > ​du -sh * +du -sh * 
-20M     bin +47M     bin 
-0       compiler_compat +16K     ​cmake 
-4.0K    condabin +8.0K    ​compiler_compat 
-684K    ​conda-meta +32M     ​_conda 
-0       envs +8.0K    condabin 
-16K     etc +968K    ​conda-meta 
-5.5M    ​include +4.0K    ​envs 
-4.0K    info +28K     etc 
-198M    lib +18M     include 
-12K     LICENSE.txt +317M    lib 
-114M    ​pkgs +92K     LICENSE.txt 
-604K    share +1.1M    man 
-4.0K    ​shell +231M    ​pkgs 
-0       ssl +396K    sbin 
-0       x86_64-conda_cos6-linux-gnu</​code>​+1.4M    share 
 +12K     shell 
 +8.0K    ​ssl 
 +8.0K    ​x86_64-conda_cos7-linux-gnu 
 +8.0K    x86_64-conda-linux-gnu 
 +</​code>​
  
-  * Initialize the newly installed conda environment (this will initialize the environment only in the current terminal):​ +  * Initialize the newly installed conda environment (this will initialize the environment ​**only in the current terminal**): 
-    * bash shell: ''​source <​installation_path>/​miniconda3/​etc/​profile.d/​conda.sh''​ +    * bash shell: ''​source <​installation_path>/​miniconda3_2024-03/​etc/​profile.d/​conda.sh''​ 
-    * tcsh shell: ''​source <​installation_path>/​miniconda3/​etc/​profile.d/​conda.csh''​+    * tcsh shell: ''​source <​installation_path>/​miniconda3_2024-03/​etc/​profile.d/​conda.csh''​
  
   * Check if you can use the ''​conda''​ command, and use it to initialize the //base// environment   * Check if you can use the ''​conda''​ command, and use it to initialize the //base// environment
other/uvcdat/cdat_conda/miniconda3_install.txt · Last modified: 2024/07/09 15:54 by jypeter