Anaconda配置
anaconda基本配置流程
anaconda下载
通过清华源下载anaconda:
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
选择合适的版本后一路 enter+yes 即可。
.bashrc配置
- 若一直回车,该文件已被配好,不需要更改。
若未被激活,(base)不显示
在末尾追加anaconda3的下载路径到资源文件
1
2echo 'export PATH="/home/user/anaconda3/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc ##刷新资源,使之生效创建.bash_profile,与.bashrc同目录,内容如下,创建好后
source ~/.bash_profile
1
2
3if[ -f"$HOME/.bashrc"];then
."$HOME/.bashrc"
fi
conda换源 (.condarc配置)
在命令行vim ~/.condarc
进入编辑该文件
1 | channels: |
最后的proxy_servers
是代理配置
conda使用
新建环境:
conda create -n env_name python=3.7
激活环境:
conda activate env_name
退出环境:
conda deactivate
删除环境:
conda remove -n env_name --all
查看环境列表:
conda env list
安装包:
conda install pkg_name
导出环境:
conda env export > env_name.yml
根据yaml新建:
conda env create -f env_name.yml
environment.yml:
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
30name: tactile_ssl
channels:
- pytorch
- xformers
- nvidia
- conda-forge
dependencies:
- python=3.9
- pytorch=2.0.*
- pytorch-cuda=11.8
- torchvision
- lightning=2.0.*
- xformers
- hydra-core
- hydra-colorlog
- wandb
- matplotlib
- einops
- tqdm
- scipy
- scikit-learn
- opencv
- h5py
- rich
- pip
- pip:
- rootutils
- pre-commit
- ikpy
- gdown==5.1.0
pip更换源
在命令行mkdir ~./pip && vim ~./pip/pip.conf
进入编辑该文件
1 | [global] |
注:个人理解的更换源的原因:1.官方源在国外速度慢 2.添加代理之后如果不更换源操作不了
拓展:mamba activate tactile_ssl
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.