This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
other:uvcdat:cdat_conda:miniconda3_install [2024/04/12 14:24] jypeter [Why should you use Miniconda3 ?] Cleaned |
other:uvcdat:cdat_conda:miniconda3_install [2024/05/30 13:45] jypeter [Desperately seeking a specific package] |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== JYP steps for installing Miniconda3 ====== | ====== JYP steps for installing Miniconda3 ====== | ||
+ | ===== Before installing Python on a shared computer ===== | ||
+ | |||
+ | ==== Desperately seeking a specific package ==== | ||
+ | |||
+ | Check if the Python package you are [[https://www.imdb.com/title/tt0089017/|desperately seeking]] is not already installed, before installing your own Python on shared interactive Linux servers, or on batch computing clusters !! | ||
+ | |||
+ | * Ask other users who know the local environment | ||
+ | |||
+ | * Read the servers/clusters documentation: [[https://wiki.lsce.ipsl.fr/pmip3/doku.php/other:python:starting|Python at LSCE by JYP]], [[https://intranet.lsce.ipsl.fr/informatique/index.php|LSCE]], [[https://espri.ipsl.fr/|ESPRI Computing and Data Center]], ... | ||
+ | |||
+ | * Use ''[[other:newppl:starting#using_module_to_access_optional_programs|module avail [mod_name]]]'' to find out the Python versions available, and then ''module load'' and ''conda list'' to get more information | ||
+ | * e.g. on ''spiritx'' ([[https://documentations.ipsl.fr/spirit/common/module_command.html|modules on spirit]])): <code>$ module avail python | ||
+ | python/meso-3.8 python/meso-3.9 python/meso-3.10 python/meso-3.11 | ||
+ | $ module avail anaconda | ||
+ | anaconda-meso/2022.10 anaconda3-py/2020.11 | ||
+ | anaconda-meso/2023.09-0 anaconda3-py/2021.11 | ||
+ | </code> | ||
+ | |||
+ | * Lots of Python packages do very similar things. Maybe you can use another installed package... | ||
+ | |||
+ | * If the packages you need are not available, it may be faster and easier to ask the local system administrators if they can install the packages, rather than doing everything yourself | ||
+ | |||
+ | ==== Using a specific Python on a jupyter server ==== | ||
+ | |||
+ | If there is a //jupyter notebook server// connected to your system, but the Python you want to use is not available on the server, follow the [[other:python:starting#using_a_non-standard_kernel|using a non-standard kernel]] instructions, rather than starting your own local server | ||
===== Why should you use Miniconda3 ? ===== | ===== Why should you use Miniconda3 ? ===== | ||
Line 21: | Line 46: | ||
/path_to_miniconda/envs/cdatm_py3/bin/python | /path_to_miniconda/envs/cdatm_py3/bin/python | ||
</code> | </code> | ||
- | * The //special// environment where //Miniconda3// itself is installed is called ''base''. Note that the ''python'' binary of the //special// ''base'' environment is not located in the same directory hierarchy as the ''python'' of the other environments (i.e. there is no ''envs/'' subdirectory<code>$ conda activate base | + | * The //special// environment where //Miniconda3// itself is installed is called ''base'' (it also used to be called ''root''). Note that the ''python'' binary of the //special// ''base'' environment is not located in the same directory hierarchy as the ''python'' of the other environments (i.e. there is no ''envs/'' subdirectory<code>$ conda activate base |
(base) $ which python | (base) $ which python | ||
Line 34: | Line 59: | ||
* You //could// also start with the full //Anaconda// (instead of //Miniconda//) installer that will install a much more complete python environment, ready for use.\\ **We choose not to use the full //Anaconda// installer** because: | * You //could// also start with the full //Anaconda// (instead of //Miniconda//) installer that will install a much more complete python environment, ready for use.\\ **We choose not to use the full //Anaconda// installer** because: | ||
* it requires more disk space than //Miniconda3// during the initial installation, | * it requires more disk space than //Miniconda3// during the initial installation, | ||
- | * all the //Anaconda// installer packages come from the ''default'' //channel// (or //repository//) provided by the [[https://anaconda.org/|conda repository]].\\ This is not very useful for us (and could even cause complex dependency problems later) because we will be mostly using (the same) packages provided by the [[https://conda-forge.org/feedstock-outputs/|conda-forge]] //channel//, **in order to avoid complex package dependency problems**. | + | * all the //Anaconda// installer packages come from the ''default'' //channel// (or //repository//) provided by the [[https://anaconda.org/|conda repository]].\\ This is not very useful for us (and could even cause complex dependency problems later) because we will be mostly using (the same) packages provided by the [[https://conda-forge.org/feedstock-outputs/|conda-forge]] //channel//, **in order to avoid complex package dependency problems** |
+ | |||
+ | |||
+ | ===== Downloading Miniconda3, and BASIC installation ===== | ||
+ | |||
+ | ==== Miniconda3 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 | ||
+ | |||
+ | === Downloading the Miniconda3 installer on Windows === | ||
+ | |||
+ | * We use a download link that always point to the [[https://docs.anaconda.com/free/miniconda/#latest-miniconda-installer-links|latest version of the Windows installer]] | ||
+ | * https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe | ||
+ | * The installer is based on **Python 3.12.2 and Conda 24.3.0 as of April 2024** | ||
+ | |||
+ | * Find some temporary space on Windows | ||
+ | * e.g. ''C:\Scratch\your_login'' or whatever you use as a [[other:win10config#local_scratch_folder|local Scratch folder]] | ||
+ | |||
+ | * Open a //terminal//, where you can type the required installation commands | ||
+ | * Windows //Powershell terminal//: ''Start'' => ''W'' => ''Windows PowerShell'' => ''Windows PowerShell'' | ||
+ | * [[other:win10apps#windows_terminal|PowerShell in a Windows Terminal]] | ||
+ | |||
+ | * Use ''curl'' to download the latest installer (78 Mb as of April 2024): <code>PS C: cd C:\Scratch\your_login | ||
+ | PS C:\Scratch\your_login> curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe -o miniconda.exe | ||
+ | PS C:\Scratch\your_login> dir miniconda.exe | ||
+ | [...] | ||
+ | -a---- 19/04/2024 11:18 81274240 miniconda.exe</code> | ||
+ | |||
+ | === BASIC Miniconda3 installation on Windows === | ||
+ | |||
+ | * **Determine the folder where you will install Miniconda3 and ALL your future Python environments** based on this version of Miniconda3\\ **We will later refer to this location as ''/path_to_miniconda3/''** in the Linux sections | ||
+ | * Remember that **you will need a few Gb of available space** | ||
+ | * You should **avoid installing Miniconda3 in your Windows //home// folder** (''C:\Users\your_login'' or [[other:win10config#local_home_folder|<some_disk_different_from_c>:\Users\<your_login>]]), if you want to be able to easily make backups or your //home//, without backing up thousands of files related to your Python environments... | ||
+ | * We add some date or version information at the end of the folder name, in order to differentiate it from other (older of future) installations | ||
+ | * Example installation folder: ''C:\Utils\miniconda3_2024-03'' (if we start installing in March 2024) | ||
+ | |||
+ | * Launch the Miniconda3 installer with<code>PS C:\Scratch\your_login> .\miniconda.exe</code> | ||
+ | |||
+ | * In the installer window: | ||
+ | * (Review and) accept the License Agreement | ||
+ | * Choose to install for //Just Me// (the recommended default choice) | ||
+ | * Specify the //Destination Folder// selected above, e.g. ''C:\Utils\miniconda3_2024-03'' | ||
+ | * Use the pre-selected //Advanced Installation Options//, i.e | ||
+ | * //Create start menu shortcutes// | ||
+ | * //Register Miniconda3 as my default Python 3.12// <= Useful? | ||
+ | |||
+ | * When the installer has finished running, you should have: | ||
+ | * A new ''C:\Utils\miniconda3_2024-03'' folder | ||
+ | * This folder size will be ~650 Mb and will keep on growing (up to several Gb) as you add more Python environments and packages | ||
+ | * => **Be sure to have enough space on this disk!** | ||
+ | * Two new shortcuts in the Windows ''Start'' menu | ||
+ | * ''Anaconda Prompt'' | ||
+ | * ''Anaconda Powershell Prompt'' | ||
+ | * **We will now use this //Anaconda PowerShell// shortcut each time we need to use Miniconda3 or Python** | ||
+ | |||
+ | * Remove the installer<code>PS C:\Scratch\your_login> del .\miniconda.exe</code> | ||
+ | |||
+ | * Open an //Anaconda PowerShell Prompt//, and type a few commands to make sure that ''conda'' is working<code>(base) PS C:\Users\your_login> conda env list | ||
+ | base * C:\Utils\miniconda3_2024-03 | ||
+ | |||
+ | (base) PS C:\Users\your_login> conda list | ||
+ | # packages in environment at C:\Utils\miniconda3_2024-03: | ||
+ | # Name Version Build Channel | ||
+ | [...] | ||
+ | conda 24.3.0 py312haa95532_0 | ||
+ | [...] | ||
+ | python 3.12.2 h1d929f7_0 | ||
+ | [...] | ||
+ | |||
+ | (base) PS C:\Users\your_login> conda deactivate | ||
+ | |||
+ | PS C:\Users\your_login> conda env list | ||
+ | base C:\Utils\miniconda3_2024-03</code> | ||
+ | |||
+ | * Next: be sure to <wrap hi>follow the steps in the [[other:uvcdat:cdat_conda:miniconda3_install#fine-tuning_conda_to_use_only_conda-forge|Fine-tuning conda to use (only) conda-forge]], and all the other Miniconda3 instructions</wrap> | ||
+ | * ''conda'' commands will work on all computers (Windows and Linux-like) | ||
+ | * The ''.condarc'' is located in your Windows //home// folder\\ => ''C:\Users\your_login\.condarc'' | ||
+ | |||
+ | ==== Miniconda3 on a Linux-like computer ==== | ||
- | ===== Installing miniconda3 on a Linux-like computer ===== | ||
<WRAP center round tip 60%> | <WRAP center round tip 60%> | ||
By **//Linux-like//**, we mean: | By **//Linux-like//**, we mean: | ||
- | * A native Linux computer (or server) | + | * A **Linux** desktop/laptop |
- | * A windows 10 computer with [[other:win10wsl|WSL+Ubuntu installed]] | + | * The installation will be used by **one** person |
- | * A Mac where you can use Linux in a terminal | + | * A **Linux** server |
+ | * The installation will be used by **one or more** persons | ||
+ | * A **windows computer with [[other:win10wsl|WSL+Ubuntu installed]]** | ||
+ | * You should use the [[#miniconda3_on_a_windows_computer|Windows installer]], if all the packages you need are available for Windows | ||
+ | * The installation will be used by **one** person | ||
+ | * A **Mac** where you can use Linux in a terminal | ||
+ | * The installation will be used by **one** person | ||
</WRAP> | </WRAP> | ||
- | <WRAP center round info 60%> | ||
- | **//Pure Windows//** Note: you can also follow the steps listed in 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, and then follow the steps listed in the next sections of this page.\\ We assume below that the installer is downloaded in the ''C:\Scratch\your_login'' directory, and we install Miniconda3 in a ''C:\Utils\miniconda3_2024-03'' directory. <code>PS C: cd C:\Scratch\your_login | ||
- | PS C:\Scratch\your_login> curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe -o miniconda.exe | ||
- | PS C:\Scratch\your_login> .\miniconda.exe | ||
- | PS C:\Scratch\your_login> del .\miniconda.exe | ||
- | </code> | ||
- | </WRAP> | ||
+ | === Downloading the Miniconda3 installer === | ||
- | ==== Downloading the Miniconda3 installer ==== | + | * Important: <wrap hi>do not install your own Python environment(s) on shared computers before you have made sure that the packages you need are not already installed, or cannot be easily installed in an existing environment (by the person who maintains this environment)!</wrap> |
+ | * Check the output of ''module avail'', read your system documentation, ask other users... | ||
* We use a download link that always point to the [[https://docs.anaconda.com/free/miniconda/#latest-miniconda-installer-links|latest version of the Linux installer]] | * We use a download link that always point to the [[https://docs.anaconda.com/free/miniconda/#latest-miniconda-installer-links|latest version of the Linux installer]] | ||
* 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 | * 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 | ||
* Note: Mac users should use the latest [[https://docs.anaconda.com/free/miniconda/#latest-miniconda-installer-links|macOS installer]] appropriate for their computer | * Note: Mac users should use the latest [[https://docs.anaconda.com/free/miniconda/#latest-miniconda-installer-links|macOS installer]] appropriate for their computer | ||
- | * The installer is based on **Python 3.12 as of March 2024** | + | * The installer is based on **Python 3.12.2 and Conda 24.3.0 as of April 2024** |
* Find some temporary space on Linux (or Windows, if you are using [[other:win10wsl|WSL]]) | * 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 on the **LSCE** servers:\\ ''$ cd /home/scratch01/$USER'' |
- | * e.g. Linux at **spiritx**:<code>$ mkdir /homedata/$USER/Scratch | + | * e.g. Linux on the IPSL **spiritx** cluster:<code>$ mkdir /homedata/$USER/Scratch |
$ cd /homedata/$USER/Scratch</code> | $ cd /homedata/$USER/Scratch</code> | ||
- | * e.g. Linux on a **personal PC/Mac desktop/laptop**: use a scratch/temporary directory with //enough// space | + | * e.g. Linux on a **personal PC/Mac desktop/laptop**: use a local scratch/temporary directory with //enough// space |
* 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 | * 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 | ||
Line 72: | Line 176: | ||
[...] 138M Feb 27 20:40 Miniconda3-latest-Linux-x86_64.sh</code> | [...] 138M Feb 27 20:40 Miniconda3-latest-Linux-x86_64.sh</code> | ||
- | ==== Using the Miniconda3 installer ==== | + | === Using the Miniconda3 installer === |
We assume below that we are in the [[#downloading_the_installer|directory where we have downloaded the installer]] | We assume below that we are in the [[#downloading_the_installer|directory where we have downloaded the installer]] | ||
Line 154: | Line 258: | ||
* Remove the //Miniconda3// installer: ''$ rm Miniconda3-latest-Linux-x86_64.sh'' | * Remove the //Miniconda3// installer: ''$ rm Miniconda3-latest-Linux-x86_64.sh'' | ||
- | ==== Fine-tuning conda to use (only) conda-forge ==== | + | |
+ | ===== Fine-tuning conda to use (only) conda-forge ===== | ||
* ''conda'' will probably work fine with the default settings **if you create simple new environments** with just one package and its dependencies. | * ''conda'' will probably work fine with the default settings **if you create simple new environments** with just one package and its dependencies. | ||
Line 202: | Line 307: | ||
* Check the current version of ''conda'' | * Check the current version of ''conda'' | ||
- | * <code>$ conda list -n base | grep conda | + | * <code>$ conda list -n base | grep '^conda' |
# packages in environment at /path_to_miniconda: | # packages in environment at /path_to_miniconda: | ||
conda 24.1.2 py312h06a4308_0 | conda 24.1.2 py312h06a4308_0 | ||
Line 297: | Line 402: | ||
</code> | </code> | ||
===== Initializing conda in terminals ===== | ===== Initializing conda in terminals ===== | ||
+ | <WRAP center round tip 60%> | ||
+ | |||
+ | Reminder: if you have installed Miniconda3 on a Windows computer, you only have to open a terminal with | ||
+ | |||
+ | * ''Start'' menu => ''Anaconda Powershell Prompt'' | ||
+ | * ''conda activate the_environment_you_want'' | ||
+ | </WRAP> | ||
+ | |||
When you open a terminal, your shell needs to know where to find the ''conda'' command used to initialize an environment, or switch between existing environments. This can be **configured in the //shell// configuration files** | When you open a terminal, your shell needs to know where to find the ''conda'' command used to initialize an environment, or switch between existing environments. This can be **configured in the //shell// configuration files** | ||
Line 330: | Line 443: | ||
* ask //tcsh// users to add to ''~/.cshrc'' something like\\ ''source ~main_installer_login/.conda3_jyp.csh''\\ \\ with a ''.conda3_jyp.csh'' file looking like {{ :other:uvcdat:cdat_conda:conda3_jyp.csh.txt |}} | * ask //tcsh// users to add to ''~/.cshrc'' something like\\ ''source ~main_installer_login/.conda3_jyp.csh''\\ \\ with a ''.conda3_jyp.csh'' file looking like {{ :other:uvcdat:cdat_conda:conda3_jyp.csh.txt |}} | ||
- | ===== Keeping miniconda3 up-to-date ===== | + | ===== Keeping Miniconda3 up-to-date ===== |
+ | |||
+ | * Just type ''conda update -n base %%--%%all'' as shown in the [[#updating_mini_conda|Updating (Mini)conda]] section | ||
+ | |||
+ | * The ''base'' (miniconda3) and the other environments are all independent and can be updated independently | ||
+ | |||
+ | * It is up to you to decide if you want to update environments or not | ||
+ | ===== conda resources ===== | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==== Web sites ==== | ||
+ | |||
+ | * [[https://docs.conda.io/projects/conda/en/stable/|Official conda website]] | ||
+ | * [[https://docs.conda.io/projects/conda/en/stable/user-guide/cheatsheet.html|Cheat sheet]] (2 pages, for people in a hurry) | ||
+ | * [[https://docs.conda.io/projects/conda/en/stable/commands/|Commands' reference]] | ||
+ | * Package repositories | ||
+ | * [[https://conda-forge.org/packages/|conda-forge]] <= recommended source of packages | ||
+ | * [[https://anaconda.org/|default]] | ||
+ | |||
+ | |||
+ | ==== Useful conda commands ==== | ||
+ | |||
+ | This is just a subset of some of the commands, and a subset of their options! For a complete reference, use the [[https://docs.conda.io/projects/conda/en/stable/|official conda website]] | ||
+ | |||
+ | * **Get help** | ||
+ | * ''conda -h'' | ||
+ | * ''conda //command// %%--%%help'': help for a specific //command// | ||
+ | |||
+ | * **Available environments** | ||
+ | * ''conda env list'' | ||
+ | * The currently active environment has a "*****" character on its line<code>(base) $ conda env list | ||
+ | # conda environments: | ||
+ | # | ||
+ | base * /homedata/jypmce/miniconda3_2024-03</code> | ||
+ | |||
+ | * **Activate** an existing environment (available in ''conda env list'') or **deactivate**, in order to go back to the default Python | ||
+ | * ''conda activate existing_environment'' | ||
+ | * ''conda activate'' (without specifying an environment name) will **activate the ''base'' Miniconda3 environment** | ||
+ | * Go back to the default Python available on the system | ||
+ | * ''conda deactivate'' | ||
+ | * You can type ''which python'' to determine where is the current ''python'' executable you are using is\\ You should **always know which Python you are using!** | ||
+ | * <code>(base) $ which python | ||
+ | /homedata/jypmce/miniconda3_2024-03/bin/python | ||
+ | |||
+ | (base) $ conda deactivate | ||
+ | |||
+ | $ which python | ||
+ | /usr/bin/python</code> | ||
+ | * Note: //before conda ''4.6''//, you had to type ''**source** activate existing_environment'' and ''**source** deactivate'' | ||
+ | |||
+ | * Get the **list of installed packages**, their version, and where they come from (e.g. ''conda-forge'', ''pip'') | ||
+ | * ''conda list [-n existing_environment]'' | ||
+ | |||
+ | * **Create an environment** and install a few packages and their dependencies | ||
+ | * ''conda create -n new_environment_name package1 package2 packageN'' | ||
+ | |||
+ | * **Delete an environment** | ||
+ | * ''conda remove -n crap_environment %%--%%all'' | ||
+ | |||
+ | * **Find out if a package is available** on the //conda-forge// channel (or other channels) | ||
+ | * Note: you should always install a package with ''conda'' instead of ''pip'', if it is available on a //conda channel// | ||
+ | * ''conda search package_exact_name''\\ ''conda search '*package_partial_name*''' | ||
+ | * Note: ''search'' with wildcards fails in a //tcsh// shell, as of April 2024 ([[https://github.com/conda/conda/issues/9771|CSH install/search fail with '*' variable in an argument]]) | ||
+ | |||
+ | * **Install and remove packages**\\ Add ''-n target_environment'' to make changes in another environment than the active one | ||
+ | * ''conda install package1 package2 packageN'' | ||
+ | * ''conda'' should already be [[#fine-tuning_conda_to_use_only_conda-forge|configured to use conda-forge by default]] if you have read this page carefully | ||
+ | * Add ''-c channel_url_or_alias'' to install from a specific //channel// | ||
+ | * ''conda remove package1 package2 packageN'' | ||
+ | |||
+ | * **Update** just ''conda'' (update the //conda// package, not the full Miniconda3 //base// environment) | ||
+ | * ''conda update -n base conda'' | ||
+ | |||
+ | * **Completely update an environment** (all the packages) | ||
+ | * ''conda update -n existing_environment %%--%%all'' | ||
+ | |||
+ | * **Cleaning... <wrap em>Dangerous</wrap>**!\\ If you have several environments, ''conda clean'' may remove packages that are not needed in an environment, but are still used in other environments, and **you may end up with a broken installation...**\\ ''conda'' does not automatically clean the content of the ''pkgs'' directory!\\ Use the following to //Remove index cache, lock files, tarballs, unused cache packages, and source cache// | ||
+ | * ''conda clean %%--%%all'' | ||
+ | |||
+ | |||
+ | ==== conda, pip and virtualenv ==== | ||
+ | |||
+ | * Read the [[https://docs.conda.io/projects/conda/en/stable/commands/#conda-vs-pip-vs-virtualenv-commands|Conda vs. pip vs. virtualenv commands]] section | ||
+ | |||
+ | * Read the [[https://docs.conda.io/projects/conda/en/stable/user-guide/tasks/manage-environments.html#using-pip-in-an-environment|Using pip in an environment]] | ||
+ | ==== Installation history ==== | ||
+ | |||
+ | You can get the current list of installed packages with ''conda list -n existing_environment'', but it may also be useful to know in which order the packages were installed: | ||
+ | |||
+ | * ''conda list -n existing_environment %%--%%revisions'': display **exactly** what was installed and when (including the updates, and automatic dependencies installation) | ||
+ | * You can theoretically roll back to a previous ''RR'' //revision// number with: ''conda install -n existing_environment %%--%%revision RR'' | ||
+ | * There is more information in the ''/path_to_miniconda/conda-meta/history'' installation log files. | ||
+ | * ''base'' history file: ''/path_to_miniconda/conda-meta/history'' | ||
+ | * ''existing_environment'' history file: ''/path_to_miniconda/envs/existing_environment/conda-meta/history'' | ||
+ | * e.g. installation commands for the ''base'' environment:\\ <code> $ egrep -e 'cmd:' -e '==>' /homedata/jypmce/miniconda3_2024-03/conda-meta/history | ||
+ | |||
+ | ==> 2024-02-23 18:39:23 <== | ||
+ | # cmd: constructor /tmp/tmp.4um5tGKcqW/miniconda3/ --output-dir /tmp/tmp.4um5tGKcqW | ||
+ | ==> 2024-03-27 16:10:01 <== | ||
+ | # cmd: /homedata/jypmce/miniconda3_2024-03/bin/conda update -n base --all | ||
+ | ==> 2024-03-28 11:38:08 <== | ||
+ | [...] | ||
+ | ==> 2024-04-24 17:47:32 <== | ||
+ | # cmd: /homedata/jypmce/miniconda3_2024-03/bin/conda update -n base --all</code> | ||
+ | * You can also, use a script and the ''conda'' module available **in the ''base'' environment**: [[https://github.com/conda/conda/issues/4545#issuecomment-469984684|example]] | ||
+ | ===== Uninstalling Miniconda3 ===== | ||
+ | ==== Windows computer ==== | ||
- | ===== FIXME Using mamba instead of conda ===== | + | Miniconda3 can be removed like a regular Windows application |
- | Even when using a proper ''.condarc'' in order to get packages coming only from //conda-forge//, ''conda install'' may fail to solve the dependencies after meditating during an enormous time (e.g. [[https://github.com/conda/conda/issues/9367#issuecomment-793968239|Solving environment: failed with initial frozen solve. Retrying with flexible solve.]]), when we try to deal with **complex environments** (i.e. we already have lots of installed packages and we want to add even more packages). | + | * Go to the //Apps & features// panel |
+ | * ''Start'' => ''Settings'' => ''Apps'' => ''Apps & features'' | ||
+ | * Select ''Miniconda3 py3xxxxx'' | ||
+ | * Click on ''Uninstall'' and follow the instructions displayed by the uninstaller window | ||
+ | * This will remove: | ||
+ | * The (very big) directory that you specified when you installed //Miniconda3// | ||
+ | * The ''conda'' shortcuts from the ''Start Menu'' | ||
+ | * This will **not** remove your local configuration file ''C:\Users\your_login\.condarc'' | ||
- | Using CDAT as a base environment, and adding a lot of extra packages is a **complex environment**. | + | ==== Linux-like computer ==== |
- | The only solution seems to replace ''conda'' with [[https://github.com/mamba-org/mamba|mamba]], a reimplementation of the conda package manager in C++ ([[https://wolfv.medium.com/making-conda-fast-again-4da4debfb3b7|Making conda fast again]]): | + | FIXME |
- | * Install ''mamba'' in the //base// (i.e. //miniconda//) environment\\ ''conda install mamba -n base -c conda-forge'' | + | |
- | * Use ''mamba'' instead of ''conda'' when installing packages.\\ Theoretically, you don't need to specify ''install -c conda forge'' any more, because ''conda-forge'' is now the default source of new packages\\ ''mamba install lots_of_packages'' | + | |