Tuesday, January 20, 2026

Install Anaconda on WSL Ubuntu Terminal

Steps to Install Anaconda on Windows Ubuntu Terminal

Setting up Anaconda on the Windows Subsystem for Linux (WSL) involves enabling WSL on Windows 11, installing a Linux distribution (like Ubuntu), and then installing the Linux version of the Anaconda distribution within that Linux environment
Install WSL (Ubuntu for Windows - can be found in Windows Store). I recommend the latest version (I'm using 25.04) because there are some bugs they worked out during 
Prerequisites
  • Windows 11 with WSL Enabled: Ensure WSL is installed and enabled. You can do this by opening PowerShell or Command Prompt as an administrator and running wsl --install. You may need to restart your computer after installation.
  • A Linux Distribution: Install a distribution like Ubuntu from the Microsoft Store.
  • Internet Connection: Required to download the Anaconda installer. 
Step-by-Step Guide
  1. Open your WSL terminal.
    Search for your installed Linux distribution (e.g., Ubuntu) in the Windows Start menu and open it. A terminal window will open.
  2. Update your Linux environment.
    It is good practice to update your package lists before installing new software:
    bash
    sudo apt update && sudo apt upgrade -y
    
  3. Download the Anaconda installation script.
    Use wget to download the latest Anaconda installer script for Linux (64-bit x86 architecture). You can find the latest version link on the Anaconda website.
    bash
    wget https://repo.anaconda.com -O anaconda_installer.sh
    
    (Note: The version number in the command might change over time; check the Anaconda website for the most current file name).
  4. Run the installation script.
    Execute the downloaded script using bash:
    bash
    bash anaconda_installer.sh
    
  5. Follow the installation prompts.
    • Press Enter to review the license agreement.
    • Type yes to accept the license terms.
    • Press Enter to accept the default installation location (/home/your_username/anaconda3), or specify a different path.
    • When prompted "Do you wish the installer to initialize Anaconda3...?", type yes. This modifies your shell configuration (e.g., ~/.bashrc) to automatically activate the conda base environment when you open the terminal.
  6. Close and reopen your terminal.
    For the changes to the shell configuration to take effect, you must close the current terminal window and open a new one. You should see (base) in your command prompt, indicating that Anaconda is active.
  7. Verify the installation.
    Run a simple command to confirm that Anaconda and Conda are working correctly:
    bash
    conda list
    
    If successful, a list of installed packages will appear.  
 Finalize and Verify
To apply the changes, reload your shell or restart the terminal. 
  1. Source your profile: Run source ~/.bashrc to refresh your configuration.
  2. Verify installation: Type conda list. If you see a list of packages, the setup was successful.
  3. Manage environments: You can now create your first environment using:
    bash
    conda create -n myenv python=3.10
  1. Manage environments: 
    1. You can now create your first environment using:
      bash
      conda create -n MasudRana ## My Environment Name
    2. Activate Conta environment:
  1. bash
    conda activate MasudRana
You have now successfully set up Anaconda on WSL on Windows 11. You can start creating environments and managing packages using conda commands. 

Some relevant miscellaneous topics:

  1. How to install WSL on Windows-11

No comments:

Post a Comment

Install Anaconda on WSL Ubuntu Terminal

Steps to Install Anaconda on Windows Ubuntu Terminal Setting up Anaconda on the Windows Subsystem for Linux (WSL) involves enabling WSL on W...