Miniconda#
Miniconda is a free minimal installer for conda. It is a small, bootstrap version of Anaconda that includes only conda, Python, the packages they depend on, and a small number of other useful packages, including pip, zlib, and a few others.
Installation#
To install Miniconda, download the installer from the Miniconda website and run the installer. The installer will ask you to accept the license agreement, choose the installation directory, and add the conda path to your shell profile.
Usage#
After installing Miniconda, you can open the Anaconda Prompt or Terminal to create a new environment and install packages required for this course using the following commands:
conda create -n geo python=3.11
conda activate geo
conda install -n base mamba -c conda-forge
mamba install -c conda-forge geemap leafmap
Accessing Conda in Windows Terminal#
If you did not add Conda to your PATH during installation, you can do it manually:
Open the Start Menu and search for “Environment Variables.”
Click on “Edit the system environment variables.”
In the System Properties window, click on “Environment Variables.”
Under “System Variables,” find the
Path
variable and select it.Click “Edit” and then “New.”
Add the following paths to the list:
C:\Users\<YourUsername>\miniconda3\Scripts
Click “OK” to close all windows.
Common Commands#
Here are some common commands to manage environments and packages using conda:
Creating and Managing Environments#
Create a new environment:
conda create -n myenv python=3.11
Replace
myenv
with your desired environment name andpython=3.11
with the version of Python you need.Activate an environment:
conda activate myenv
Deactivate the current environment:
conda deactivate
List all environments:
conda env list
Remove an environment:
conda remove -n myenv --all
Installing and Managing Packages#
Install a package in the current environment:
conda install numpy
Install a package in a specific environment:
conda install -n myenv pandas
Install packages from the conda-forge channel:
conda install -c conda-forge geopandas
Install multiple packages at once:
conda install scipy matplotlib seaborn
Update all packages in an environment:
conda update --all
Search for a package:
conda search scikit-learn
List all installed packages in the current environment:
conda list
Remove a package:
conda remove numpy
Using Mamba (Faster Package Management)#
After installing Mamba, you can use it for faster package management:
Install mamba in the base environment:
conda install -n base mamba -c conda-forge
Install packages using mamba:
mamba install -c conda-forge geemap leafmap
These commands should help you effectively manage your Python environments and packages using Miniconda.