- 一、Anaconda
- 1.1创建环境基本操作
- 1.2 添加源
- 二、linux实用命令
- 2.1 requirements.txt
// 查看现有环境 conda info --env
// 创建环境 conda create --name env_name python=3.6 //python版本需要在此指定
// 进入环境 conda activate env_name
// 删除环境 conda env remove -n env_name
// 退出环境 conda deactivate
// 安装包 conda install xxxx pip install xxxx
// 查看某个环境内的包 conda list //需要先进入此环境1.2 添加源
// 清华源 conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda 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 --set show_channel_urls yes
// 中科大源 conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/ conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/ conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/ conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/ conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/ conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/ conda config --set show_channel_urls yes二、linux实用命令 2.1 requirements.txt
在查看别人的Python项目时,经常会看到一个requirements.txt文件,里面记录了当前程序的所有依赖包及其精确版本号。这个文件有点类似与Rails的Gemfile。其作用是用来在另一台PC上重新构建项目所需要的运行环境依赖。
// 生成requirements.txt文件(二选其一) pip freeze > requirements.txt conda list -e > requirements.txt
// 安装requirements.txt文件(二选其一) pip install -r requirements.txt conda install --yes --file requirements.txt



