Ubuntu 22.04 configure pytorch

The Ubuntu system is different from the Windows system, so don't download it from the official website

1. Open the command window and enter

sudo apt update

2. Download the curl -y package

sudo apt install curl -y

3. Convert the current working directory to /tmp

cd /tmp

4. curl install Anaconda installer script

curl --output anaconda.sh https://repo.anaconda.com/archive/Anaconda3-2022.05-Linux-x86_64.sh

Download and install Anaconda on ubuntu 22.04

bash anaconda.sh

The Anacoda installation manual will appear and press Enter

insert image description here

 

Appears 'yes' or 'no': fill in yes

Anaconda3 will now be installed into this location:
/home/xxx/anaconda3

  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify a different location below

[/home/xxxx/anaconda3] >>> 

When this page appears, fill in done

After all is completed, close the terminal and reopen it, the prefix appears base

(base) czc@czc-Lenovo-Legion-R9000P2021H:~$ 

enter

conda list

 

The installation is complete when the following conditions occur

Here are some basic instructions for using conda

# 1.查看conda的版本号
conda --version
# 2.查看虚拟环境列表
conda info --envs
# 3.创建虚拟环境并指定python的版本号为3.8
conda create -n virtualname pip python=3.9
# 4.激活虚拟环境
conda activate virtualname
# 5.退出虚拟环境
conda deactivate
# 6.删除虚拟环境
conda remove --name virtualname --all


 

# 1.安装包
conda install PackageName
# 2.安装多个包
conda install name1 name2 ...
# 3.安装包并指定版本号
conda install PackageName=版本号
# 4.卸载包
conda remove PackageName
# 5.更新包
conda update PackageName
# 6.更新环境中的所有包
conda update --all
# 7.列出已安装的包
conda list
# 8.搜寻包
conda search PackageName

Guess you like

Origin blog.csdn.net/weixin_45303602/article/details/129783881