Anaconda Notes
Anaconda Installation
To install Anaconda on your Debian 11 system, follow these steps:
Download the latest version of Anaconda installer for Linux: Open a terminal window and download the latest Anaconda installer for Linux using wget. Replace https://repo.anaconda.com/archive/Anaconda3-2021.05-Linux-x86_64.sh with the latest URL available at https://www.anaconda.com/products/distribution#linux.
wget https://repo.anaconda.com/archive/Anaconda3-2021.05-Linux-x86_64.sh
Verify the installer integrity: Before running the installer, it's recommended to verify the integrity of the downloaded file using sha256sum. Compare the output with the hash provided on the Anaconda website.
sha256sum Anaconda3-2021.05-Linux-x86_64.sh
Run the installer: Make the installer script executable and run it. Follow the on-screen instructions to complete the installation.
chmod +x Anaconda3-2021.05-Linux-x86_64.sh
./Anaconda3-2021.05-Linux-x86_64.sh
Accept the license terms and choose the installation location. The installer will show the default location, but you can change it if needed.
Initialize Anaconda:
After the installation is complete, you will be prompted to initialize Anaconda by running conda init. This step will modify your .bashrc file to add Anaconda to your PATH.
source ~/.bashrc
Verify the installation: To confirm that Anaconda is installed correctly, you can check the version of the installed conda package manager.
conda --version
Now, you have successfully installed Anaconda on your Debian 11 system. You can start using it to create environments and manage packages.
Create Virtual Environment
To create a Python 3.8 virtual environment using Anaconda, follow these steps:
If you haven't installed Anaconda already, download it from the official website (https://www.anaconda.com/products/distribution) and install it on your system.
Open Anaconda Prompt (on Windows) or Terminal (on macOS and Linux).
Create a new conda environment with Python 3.8:
conda create -n my_env python=3.8
Replace my_env with the desired name for your virtual environment.
Activate the new conda environment:
conda activate my_env
Now you have successfully created a Python 3.8 virtual environment using Anaconda. You can install packages using conda install or pip install as needed.
When you want to deactivate the environment and return to the base conda environment, run:
conda deactivate
Remove anaconda environment
conda env remove --name myenv