Conda
常用命令
换源
sh
conda config --add channels [url]
[!example]+ 清华源
shconda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud//pytorch/ conda config --set show_channel_urls yes
创建环境
sh
conda create -n [EnvName] python=[Version]
[!example]+
shconda create -n TEST python=3.8
切换环境
sh
conda activate [EnvName]
退出环境
shell
conda deactivate
环境列表
shell
conda env list
删除环境
shell
conda env remove -n [EnvName]
基础环境配置
Jupyter
环境
shell
conda install jupyter
Python
Data Analysis
shell
# 创建数据分析环境
conda create -n data_analysis python=3.9
# 激活环境
conda activate data_analysis
# 安装常用的数据分析库
conda install numpy pandas matplotlib seaborn scikit-learn jupyter
# 安装其他有用的数据分析工具
conda install -c conda-forge jupyterlab ipython statsmodels
Causality
shell
conda create -n Causality python -y
conda activate Causality
conda install numpy pandas matplotlib seaborn scikit-learn jupyter -y
conda install -c conda-forge dowhy -y
Deep Learning
shell
# 创建深度学习环境
conda create -n deep_learning python=3.9
# 激活环境
conda activate deep_learning
# 安装 TensorFlow
conda install tensorflow
# 安装 PyTorch
conda install pytorch torchvision torchaudio cpuonly -c pytorch
# 安装其他常用的深度学习库
conda install -c conda-forge keras matplotlib pandas scikit-learn jupyter
CV
shell
# 创建计算机视觉环境
conda create -n computer_vision python=3.9
# 激活环境
conda activate computer_vision
# 安装 OpenCV
conda install -c conda-forge opencv
# 安装其他常用的计算机视觉库
conda install numpy matplotlib scikit-learn jupyter
# 安装深度学习库(用于计算机视觉任务)
conda install tensorflow pytorch torchvision torchaudio cpuonly -c pytorch
# 安装图像处理库
conda install scikit-image pillow
NLP
shell
# 创建 NLP 环境
conda create -n nlp python=3.9
# 激活环境
conda activate nlp
# 安装常用的 NLP 库
conda install -c conda-forge spacy nltk gensim
# 安装深度学习库
conda install snownlp tensorflow pytorch torchvision torchaudio cpuonly -c pytorch
# 安装其他有用的库
conda install pandas scikit-learn matplotlib
# 安装 transformers 库(用于预训练模型)
pip install transformers
# 安装 jupyter 和 jupyterlab
conda install -c conda-forge jupyter jupyterlab
# 下载和安装 spaCy 语言模型(例如 en_core_web_sm)
python -m spacy download en_core_web_sm
R
sh
conda create -n bioinfo_r_env r-base r-essentials