# Basic environment with specific Python version
conda create -n myenv python=3.12
# Environment with multiple packages from the start
conda create -n geoenv python=3.12 numpy pandas matplotlib
# Create environment with packages from specific channels
conda create -n geoenv2 python=3.12 -c conda-forge geopandas
conda activate myenv
conda deactivate
conda env list
# or
conda info --envs
# Remove entire environment and all its packages
conda remove -n myenv --all
# Alternative method using env remove
conda env remove -n myenv
# Create a copy of an existing environment
conda create -n newenv --clone oldenv
# Install a package from the main channel
conda install numpy
# Install multiple packages from the main channel
conda install scipy matplotlib seaborn
# Install specific versions
conda install numpy=1.24.0 pandas>=1.5.0
# Install without activating the environment
conda install -n myenv pandas
# Useful for setting up environments remotely
conda install -n geoenv -c conda-forge geopandas rasterio
# Install from conda-forge (recommended for geospatial packages)
conda install -c conda-forge geopandas
# Update all packages in current environment
conda update --all
# Update specific packages
conda update numpy pandas
# Update conda itself
conda update conda
# Search for packages
conda search scikit-learn
conda search "*gdal*" # wildcard search
# Get package information
conda search -c conda-forge geopandas --info
# List all installed packages
conda list
# List packages matching a pattern
conda list "*geo*"
# Remove a single package
conda remove numpy
# Remove multiple packages
conda remove scipy matplotlib
# Remove packages and their dependencies (if not needed by others)
conda remove numpy --all
# Install mamba in the base environment (do this once)
conda install -n base mamba -c conda-forge
# These commands are much faster with mamba
mamba create -n geofast python=3.12
mamba activate geofast
mamba install -c conda-forge geopandas rasterio geemap leafmap
# All conda commands work with mamba
mamba list
mamba update --all
mamba remove geopandas
# Navigate to your project directory
cd /path/to/your/project
# Create a virtual environment
uv venv
# Create with specific Python version
uv venv --python 3.12
# Activate the environment (varies by OS)
# On macOS/Linux:
source .venv/bin/activate
# On Windows:
.venv\Scripts\activate
# Install packages
uv pip install jupyterlab leafmap
# Install from requirements file
uv pip install -r requirements.txt
# Run Python directly in the environment
uv run python script.py
# Run Jupyter directly
uv run jupyter lab