Install Anaconda on Ubuntu 20.04 (server version)

0. Introduction to Anaconda

Anaconda is an open source Python distribution that includes more than 180 scientific packages and their dependencies, including Python, Conda, and scientific computing libraries. Therefore, after installing Anaconda, there is no need to install CUDA, Python, etc. separately.

CUDA, when doing deep learning, needs to use GPU, CUDA is a tool to call GPU. Only NVidia graphics cards can use CUDA. The existing mainstream deep learning frameworks are basically based on CUDA for GPU acceleration.
cuDNN and CUDA are regarded as a workbench equipped with many tools, such as hammers and screwdrivers. cuDNN is a CUDA-based deep learning GPU acceleration library. With it, deep learning calculations can be completed on the GPU. It is equivalent to a working tool, for example, it is a wrench. But when the CUDA workbench was bought, no wrench was given. If you want to run a deep neural network on CUDA, you need to install cuDNN, just like you need to buy a wrench if you want to twist a nut. This enables the GPU to do the work of deep neural networks.
insert image description here

1. Download Anaconda

(1) Official download address: https://www.anaconda.com/products/individual#download-section Download is slow
(2) Tsinghua University open source software mirror download site: https://mirrors.tuna.tsinghua.edu. cn/help/anaconda/
(3) Beijing Foreign Studies University open source software mirror download site: https://repo.anaconda.com/archive/

Install Anaconda

(1) Enter the command to start the installation:

bash Anaconda3-2023.07-1-Linux-x86_64.sh

(2) Check the license after pressing Enter, press q to exit and read the license
(3) Enter yesto agree
(4) Confirm the installation path, /root/anaconda3, you can directly press Enter to confirm, or you can manually enter the path you want to install .
insert image description here
(5) Then wait, the installation will be completed soon. Enter yes to confirm using conda init to start
insert image description here

3 Start environment variables

If you enter conda now, it will show that the command cannot be found. You
need to start and modify the environment variables, and enter the following command (you don’t need to source anymore, because it will automatically source when you start Ubuntu)

source ~/.bashrc

At this time, you will find that (base)

insert image description here

4 upgrade conda

If the current installation is not the latest version, you can upgrade it with the following command

conda update -n base -c defaults conda

5 Create a virtual environment

Enter the following command to create a virtual environment named yolov8, and the python version is 3.8.12

conda create -n yolov8 python=3.8.12

After entering y and pressing Enter, start downloading and creating

6 Enter the virtual environment

conda activate yolov8

7 Other conda commands

#创建虚拟环境
conda create -n your_env_name python=X.X(3.6、3.7等)
 
#激活虚拟环境
source activate your_env_name(虚拟环境名称)
 
#退出虚拟环境
source deactivate your_env_name(虚拟环境名称)
 
#删除虚拟环境
conda remove -n your_env_name(虚拟环境名称) --all
 
#查看安装了哪些包
conda list
 
#安装包
conda install package_name(包名)
conda install scrapy==1.3 # 安装指定版本的包
conda install -n 环境名 包名 # 在conda指定的某个环境中安装包
 
#查看当前存在哪些虚拟环境
conda env list 
#或 
conda info -e
#或
conda info --envs
 
#检查更新当前conda
conda update conda
 
#更新anaconda
conda update anaconda
 
#更新所有库
conda update --all
 
#更新python
conda update python

Guess you like

Origin blog.csdn.net/MacWx/article/details/132262488