Managing Development Environments with conda, nvm, and rustup

Modern development often requires more than just installing one language runtime globally and calling it a day. Installing everything system-wide quickly becomes messy, hard to reproduce, and annoying to debug. This is where command-line environment and toolchain managers come in. Three important examples are:

  • conda for Python-centric environments and mixed native dependencies
  • nvm for Node.js versions
  • rustup for Rust toolchains

These tools all help developers install, manage, and switch between multiple development environments without constantly modifying the system-wide setup.

Conda

conda is strongest when your environment includes more than pure Python packages. It can manage:

  • Python itself
  • Python libraries
  • native libraries
  • command-line tools
  • GPU-related packages such as CUDA stacks

That makes it especially practical for data science, machine learning, and scientific computing.

Install Miniconda

A lightweight way to start is Miniconda.

Create an installation directory:

1
mkdir -p ~/miniconda3

Download the installer:

  • Linux x86_64:
    1
    wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
  • macOS arm64:
    1
    curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh -o ~/miniconda3/miniconda.sh
  • macOS x86_64:
    1
    curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -o ~/miniconda3/miniconda.sh

Run the installer:

1
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3 && rm ~/miniconda3/miniconda.sh

Activate conda in the current shell:

1
source ~/miniconda3/bin/activate

Initialize shell integration if desired:

1
conda init --all

Reverse that change if needed:

1
conda init --all --reverse

Common Conda Commands

Create an environment:

1
conda create --name myenv python=3.12

Activate it:

1
conda activate myenv

Install packages:

1
conda install numpy pandas

List environments:

1
conda env list

Export the environment:

1
conda env export > environment.yml

Recreate it elsewhere:

1
conda env create -f environment.yml

Remove an environment:

1
conda env remove --name myenv

nvm

nvm stands for Node Version Manager. Its job is simple and extremely useful: it lets you install multiple Node.js versions and switch between them from the shell. This matters because JavaScript projects often depend on a specific Node major version. One project may want Node 18 LTS, while another may require Node 22.

Install nvm

Install from the official script:

1
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash

Then load it into the current shell. Depending on your shell configuration, you may need:

1
2
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"

After that, verify installation:

1
nvm --version

Common nvm Commands

Install the latest LTS Node.js:

1
nvm install --lts

Install a specific version:

1
nvm install 22

List installed versions:

1
nvm ls

Switch versions in the current shell:

1
nvm use 22

Set a default version:

1
nvm alias default 22

Remove an installed version:

1
nvm uninstall 20

Project-Level Use with .nvmrc

A common pattern is to put the desired Node version in a file named .nvmrc:

1
22

Then, inside that project directory, run:

1
nvm use

This makes it easy to align a project with its expected Node version.

rustup

rustup is the official Rust toolchain manager. It installs and manages:

  • Rust compiler toolchains
  • channels such as stable, beta, and nightly
  • components like rustfmt and clippy
  • additional targets for cross-compilation

Compared with nvm, rustup is more than a version switcher. It is a full toolchain management layer for Rust development.

Install rustup

Install from the official script:

1
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Load the Rust environment into the current shell:

1
source "$HOME/.cargo/env"

Verify installation:

1
2
3
rustup --version
rustc --version
cargo --version

Common rustup Commands

Install toolchains:

1
2
3
rustup toolchain install stable
rustup toolchain install nightly
rustup toolchain install 1.78.0

List installed toolchains:

1
rustup toolchain list

Set the global default:

1
rustup default stable

Override the toolchain inside a specific project directory:

1
rustup override set nightly

Remove a toolchain:

1
rustup toolchain uninstall nightly

Add common components:

1
2
rustup component add rustfmt
rustup component add clippy

Add a compilation target:

1
rustup target add wasm32-unknown-unknown

Project-Level Use with rust-toolchain.toml

Rust projects often pin a toolchain using rust-toolchain.toml, for example:

1
2
3
[toolchain]
channel = "stable"
components = ["rustfmt", "clippy"]

This gives the project an explicit, reproducible toolchain specification.


Managing Development Environments with conda, nvm, and rustup
https://jifengwu2k.github.io/2025/07/10/Managing-Development-Environments-with-conda-nvm-and-rustup/
Author
Jifeng Wu
Posted on
July 10, 2025
Licensed under