抱歉,您的浏览器无法访问本站
本页面需要浏览器支持(启用)JavaScript
了解详情 >

记录 Anaconda3 的使用方法

Install

1
2
3
4
5
6
7
wget -P /tmp https://repo.anaconda.com/archive/Anaconda3-2020.02-Linux-x86_64.sh

sudo gedit ~/.bashrc
# .bashrc
export PATH="/home/<username>/anaconda3/bin:$PATH"

source ~/.bashrc

Use

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# set no auto activate
conda config --set auto_activate_base false

# create a new env
conda create -n <env_name>

# check all envs
conda info --envs

# activate the env
conda activate <env_name>

# deactivate env
conda deactivate <env_name>

# install package
conda install <package_name>

# list packages
conda list

# remove env
conda remove -n <env_name> --all

# set one env's python version
conda install python==3.8 -n "<env_name>"

# if pip failed
# Linux
sudo mkdir ~/.pip

sudo touch ~/.pip/pip.conf

sudo vim ~/.pip/pip.conf

# in pip.conf
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=mirrors.aliyun.com