Both sides previous revisionPrevious revisionNext revision | Previous revision |
other:uvcdat:cdat_conda:miniforge_install [2025/09/18 13:35] – [Miniforge3 on a Windows computer] Replaced several occurences of 'conda' with 'forge' jypeter | other:uvcdat:cdat_conda:miniforge_install [2025/09/19 15:02] (current) – [Miniforge3 on a Windows computer] More details jypeter |
---|
==== Miniforge3 on a Windows computer ==== | ==== Miniforge3 on a Windows computer ==== |
| |
Some of the steps below are adapted from the [[https://docs.anaconda.com/free/miniconda/#quick-command-line-install|Windows section of "Quick command line install"]] to install a //pure Windows// version of Miniconda3 | Note: some of the steps below are adapted from the //Windows// sections of [[https://www.anaconda.com/docs/getting-started/miniconda/install|Installing Miniconda]] |
| |
=== Downloading the Miniforge3 installer on Windows === | === Downloading the Miniforge3 installer on Windows === |
| |
* We use a download link that always point to the [[https://github.com/conda-forge/miniforge?tab=readme-ov-file#requirements-and-installers|latest version of the Windows installer]] | * The download link we use later always points to the latest version of the Windows installer |
* https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe | * https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe |
* September 2025: The Miniforge3 25.3.1-0 installer is based on **Python 3.12.11 and Conda 25.3.1 as of April 2024** | * September 2025: The ''Miniforge3 25.3.1-0'' installer is based on ''Python 3.12.11'' and ''Conda 25.3.1'' as of April 2024 |
| |
* Find some temporary disk space on Windows | * Find some temporary disk space on Windows |
* Open a //terminal//, where you can type the required installation commands | * Open a //terminal//, where you can type the required installation commands |
* Windows //Powershell terminal//: ''Start'' => ''W'' => ''Windows PowerShell'' => ''Windows PowerShell'' | * Windows //Powershell terminal//: ''Start'' => ''W'' => ''Windows PowerShell'' => ''Windows PowerShell'' |
* [[other:win10apps#windows_terminal|PowerShell in a Windows Terminal]] | * We recommend installing [[other:win10apps#windows_terminal|Windows Terminal]] and making it the default terminal for using Powershell |
| |
| * Use ''curl'' to download the latest installer (71 Mb as of September 2025): <code>PS C:\> cd C:\Scratch\your_login |
| |
* Use ''curl'' to download the latest installer (71 Mb as of September 2025): <code>PS C: cd C:\Scratch\your_login | |
PS C:\Scratch\your_login> curl https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe -o miniforge3.exe | PS C:\Scratch\your_login> curl https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Windows-x86_64.exe -o miniforge3.exe |
| |
PS C:\Scratch\your_login> dir miniforge3.exe | PS C:\Scratch\your_login> dir miniforge3.exe |
[...] | [...] |
* Choose to install for //Just Me// (the recommended default choice) | * Choose to install for //Just Me// (the recommended default choice) |
* Specify the //Destination Folder// selected above, e.g. ''C:\Utils\miniforge3_2025-09'' | * Specify the //Destination Folder// selected above, e.g. ''C:\Utils\miniforge3_2025-09'' |
* Use the pre-selected //Advanced Installation Options//, i.e | * Use the following //Advanced Installation Options// (probably pre-selected).\\ These options should have no side-effects on your system, or other Python installations already available on your system |
* //Create start menu shortcuts// | * //Create start menu shortcuts// |
* //Register Miniforge3 as my default Python 3.12// <= Useful? | |
* JYP note: not done yet, because we still have an old miniconda3 installed ! | |
* //Clear the package cache upon completion// | * //Clear the package cache upon completion// |
* There is no need to bookmark the web pages suggested by the installer at the end, since this web page gives all the required information | |
| |
* When the installer has finished running, you should have: | * When the installer has finished running, you should have: |
* A new ''C:\Utils\miniforge3_2025-09'' folder | * A new ''C:\Utils\miniforge3_2025-09'' folder |
* This folder size will be ~300 Mb and will keep on growing (up to several Gb) as you add more Python environments and packages | * This folder size will be ~300 Mb (as of September 2025) and will keep on growing (up to several Gb) as you add more Python environments and packages |
* => **Be sure to have enough space on the installation disk!** | * => **Be sure to have enough space on the installation disk!** |
* Two new shortcuts in the Windows ''Start''=>''M''=>''Miniforge3'' menu: | * A new shortcut in the Windows ''Start''=>''M''=>''Miniforge3'' menu: |
* ''Miniforge Prompt'' | * ''Miniforge Prompt'' |
* **We will now use this //Anaconda Powershell// shortcut each time we need to use Miniconda3 or Python** | * We will now use this ''Miniforge Prompt'' shortcut each time we need to use a ''conda'' or ''python'' related to this installation of miniforge3 |
* It is **highly recommended to [[other:win10apps#windows_terminal|install Windows Terminal and make it the default terminal application]]**, so that the ''conda'' prompts will open in a modern (and highly configurable) terminal | * We recommended to [[other:win10apps#windows_terminal|installing Windows Terminal and making it the default terminal application]], so that the ''conda'' prompts will open in a modern (and highly configurable) terminal |
| |
* Remove the installer<code>PS C:\Scratch\your_login> del .\miniforge.exe</code> | * Remove the installer<code>PS C:\Scratch\your_login> del miniforge3.exe</code> |
| |
* Open an //Anaconda PowerShell Prompt//, and type a few commands to make sure that ''conda'' is working | * Open a //Miniforge Prompt//, and type a few commands to make sure that the newly installed ''conda'' and python are working\\ Opening a Miniforge prompt will automatically initialize the Python ''(base)'' environment installed with the Miniforge3 installer. |
* ''Start''=>''M''=>''Miniconda3'' => ''Anaconda Powershell Prompt'' | * ''Start''=>''M''=>''Miniforge3'' => ''Miniforge Prompt'' |
* <code>(base) PS C:\Users\your_login> conda env list | * <code>(base) C:\Users\your_login>where.exe conda |
base * C:\Utils\miniconda3_2024-03 | C:\Utils\miniforge3_2025-09\Library\bin\conda.bat |
| C:\Utils\miniforge3_2025-09\Scripts\conda.exe |
| C:\Utils\miniforge3_2025-09\condabin\conda.bat |
| |
(base) PS C:\Users\your_login> conda list | (base) C:\Users\your_login>conda --version |
# packages in environment at C:\Utils\miniconda3_2024-03: | conda 25.3.1 |
| |
| (base) C:\Users\your_login>conda env list |
| # conda environments: |
| # |
| base * C:\Utils\miniforge3_2025-09 |
| |
| (base) C:\Users\your_login>conda list |
| # packages in environment at C:\Utils\miniforge3_2025-09: |
| # |
# Name Version Build Channel | # Name Version Build Channel |
[...] | [...] |
conda 24.3.0 py312haa95532_0 | conda 25.3.1 py312h2e8e312_1 conda-forge |
| conda-libmamba-solver 25.3.0 pyhd8ed1ab_0 conda-forge |
[...] | [...] |
python 3.12.2 h1d929f7_0 | libmamba 2.1.1 h00a3e12_0 conda-forge |
| libmambapy 2.1.1 py312h259b449_0 conda-forge |
| [...] |
| mamba 2.1.1 hbfb34a1_0 conda-forge |
| [...] |
| python 3.12.11 h3f84c4b_0_cpython conda-forge |
[...] | [...] |
| |
(base) PS C:\Users\your_login> conda deactivate | (base) C:\Users\your_login>python |
| Python 3.12.11 | packaged by conda-forge | (main, Jun 4 2025, 14:29:09) [MSC v.1943 64 bit (AMD64)] on win32 |
| Type "help", "copyright", "credits" or "license" for more information. |
| >>> import sys, pprint |
| >>> pprint.pprint(sys.path) |
| ['', |
| 'C:\\Utils\\miniforge3_2025-09\\python312.zip', |
| 'C:\\Utils\\miniforge3_2025-09\\DLLs', |
| 'C:\\Utils\\miniforge3_2025-09\\Lib', |
| 'C:\\Utils\\miniforge3_2025-09', |
| 'C:\\Utils\\miniforge3_2025-09\\Lib\\site-packages'] |
| >>> ^Z</code> |
| |
PS C:\Users\your_login> conda env list | * Check if ''conda-forge'' is the default and only channel that conda will use to update the newly installed ''base'' environment, and future environments |
base C:\Utils\miniconda3_2024-03</code> | * The ''%%--%%get channels'' command should only mention ''%%'%%conda-forge%%'%%''<code>(base) C:\Users\jypeter>conda config --get channels |
| --add channels 'conda-forge' # lowest priority</code> |
| * If you get something else, you may have a ''.condarc'' configuration file left over from a previous ''conda'' installation. Depending on its content, you may have to remove or edit the ''.condarc'' file, or it may be OK to leave it unchanged |
| * Example: you use a ''cmd'' terminal, and there is NO existing ''.condarc'' file<code>(base) C:\Users\your_login>more %HOMEPATH%\.condarc |
| Impossible d’accéder au fichier C:\Users\your_login\.condarc</code> |
| * Example: you use a Powershell terminal, and there is a configuration file. The configuration below is OK, because it only mentions the ''%%'%%conda-forge%%'%%'' channel we want<code>(base) PS C:\Users\your_login> more $HOME\.condarc |
| channels: |
| - conda-forge |
| channel_priority: strict</code> |
| |
* **Next**: be sure to <wrap hi>follow the steps in the [[other:uvcdat:cdat_conda:miniforge_install#fine-tuning_conda_to_use_only_conda-forge|Fine-tuning conda to use (only) conda-forge]], and **all** the other Miniforge3 related instructions</wrap> | * **Next**: follow **all** the other Miniforge3 related instructions for the other Operating Systems |
* ''conda'' commands will work the same way on all Operating Systems (Windows and Linux-like) | * ''conda'' **commands will work the same way on all Operating Systems** (Windows and Linux-like) |
* The ''.condarc'' is located in your Windows //home// folder\\ => ''C:\Users\your_login\.condarc'' (or ''$HOME\.condarc'') | * The ''.condarc'' is located in your Windows //home// folder\\ => ''C:\Users\your_login\.condarc'' |
| * Easily displaying the configuration file |
| * ''cmd'': ''more %HOMEPATH%\.condarc'' |
| * Powershell: ''more $HOME\.condarc'' |
| |
==== Miniconda3 on a Linux-like computer ==== | ==== Miniconda3 on a Linux-like computer ==== |
* [[https://docs.conda.io/projects/conda-build/en/latest/resources/package-spec.html#package-match-specifications|conda Package match specifications]] | * [[https://docs.conda.io/projects/conda-build/en/latest/resources/package-spec.html#package-match-specifications|conda Package match specifications]] |
* [[https://conda.io/projects/conda/en/latest/dev-guide/api/conda/models/match_spec/index.html#conda.models.match_spec.MatchSpec|Documentation in the MatchSpec class]] | * [[https://conda.io/projects/conda/en/latest/dev-guide/api/conda/models/match_spec/index.html#conda.models.match_spec.MatchSpec|Documentation in the MatchSpec class]] |
===== Uninstalling Miniconda3 ===== | ===== Uninstalling Miniforge3 ===== |
| |
==== Windows computer ==== | ==== Windows computer ==== |
| |
Miniconda3 can be removed like a regular Windows application | Miniforge3 can be removed like a regular Windows application |
| |
* Go to the //Apps & features// panel | * Go to the //Apps & features// panel |
* ''Start'' => ''Settings'' => ''Apps'' => ''Apps & features'' | * ''Start'' => ''Settings'' => ''Apps'' => ''Apps & features'' |
* Select ''Miniconda3 py3xxxxx'' | * Select ''Miniforge3 some_version_information'' |
* Click on ''Uninstall'' and follow the instructions displayed by the uninstaller window | * Click on ''Uninstall'' and follow the instructions displayed by the //uninstaller// window |
* This will remove: | * This will remove: |
* The (very big) directory that you specified when you installed //Miniconda3// | * The (very big) directory that you specified when you installed //Miniforge3// |
* The ''conda'' shortcuts from the ''Start Menu'' | * The ''Miniforge3'' shortcuts from the ''Start Menu'' |
* This will **not** remove your local configuration file ''C:\Users\your_login\.condarc'' | * This will **not** remove your local configuration file ''C:\Users\your_login\.condarc'' |
| |