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
- 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. - Update your Linux environment.
It is good practice to update your package lists before installing new software: - Download the Anaconda installation script.
Usewgetto download the latest Anaconda installer script for Linux (64-bit x86 architecture). You can find the latest version link on the Anaconda website.(Note: The version number in the command might change over time; check the Anaconda website for the most current file name). - Run the installation script.
Execute the downloaded script usingbash: - Follow the installation prompts.
- Press Enter to review the license agreement.
- Type
yesto 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.
- 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. - Verify the installation.
Run a simple command to confirm that Anaconda and Conda are working correctly:If successful, a list of installed packages will appear.
Finalize and Verify
To apply the changes, reload your shell or restart the terminal.
- Source your profile: Run
source ~/.bashrcto refresh your configuration. - Verify installation: Type
conda list. If you see a list of packages, the setup was successful. - Manage environments: You can now create your first environment using:
- Manage environments:
- You can now create your first environment using:
Activate Conta environment:
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:
No comments:
Post a Comment