Backto Python Index.
1. 安装 Installation
官网,
国内镜像源
清华最方便,
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
随系统启动 Open/Close
conda config --set auto_activate_base false
2. 常用指令
# create env
conda create --name=xxx python=3.6
# list all available envs
conda info -e
# activate env
conda activate xxx
# deactivate env
conda deactivate
# list all packages in current env
conda list
# install a new package
conda install pytorch=0.4.0 cuda92 -c pytorch
# to clone an env
conda create --name=AAA --clone=BBB
# to delete an env
conda env remove -n ENV_NAME
3. 关键包的安装
# mostly used
conda install numpy scipy pandas matplotlib pillow
# to install tensorboardx
conda install -c conda-forge tensorboardx
# to install easydict
conda install -c conda-forge easydict
不要使用 conda install opencv
,因为安装内容不全,比如VideoCapture 读视频都不行。使用 pip
pip install opencv-python opencv-contrib-python
不要使用 conda install tensorflow-gpu
, 因为官方不给版本更新。使用 pip
pip install tensorflow-gpu
4. Env 组织
按版本组织
-pyVvv_base(clean)
- pyVvv_base_cv(numpy, scipy, opencv, matplotlib, )