To Install Anaconda in Ubuntu 22.04, please refer to linuxhint.
The installer has initialized the Anacoda3 in ~/.bashrc:
# added by Anaconda3 5.3.1 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/home/xyu/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/home/xyu/anaconda3/etc/profile.d/conda.sh" ]; then
. "/home/xyu/anaconda3/etc/profile.d/conda.sh"
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/home/xyu/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<
I pasted the code to my ~/.bash_profile in order to make my tmux also initialize the Anacoda3.
Check and update conda:
Viewing a list of installed packages:
Viewing a list of existed virtual environment:
Create Python virtual environment:
I checked Active Python Release, then created environment of 3.10, 3.9, 3.8 and 3.7 versions.
To activate a environment:
To deactivate an active environment:
To remove a environment:
To remove some package of a environment:
To install a package into your current environment:
To install specific a specific version of a package:
We can install multiple packages at once.
It is recommended to install all required packages at once so that all of the dependencies are installed at once.
To install a specific package into your existing environment your_env_name:
If the package is not available in our conda environment , we can find and install the package with another package manager like pip.
We can install pip in our existing conda environment by simply giving the command:
VS Code not detecting package in conda environment