zoukankan      html  css  js  c++  java
  • conda、pip换源以及conda、pip命令比较

    conda换源:

    旧换源设置:

    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 --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
    conda config --set show_channel_urls yes

    新换源设置:

    修改用户目录下的 .condarc 文件:

    channels:
      - defaults
    show_channel_urls: true
    channel_alias: https://mirrors.tuna.tsinghua.edu.cn/anaconda
    default_channels:
      - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
      - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
      - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
      - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
      - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
    custom_channels:
      conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

    pip换源:

    pip install pip -U
    pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

    conda 命令参考:

    https://docs.conda.io/projects/conda/en/latest/commands.html

    Task

    Conda package and environment manager command

    Pip package manager command

    Virtualenv environment manager command

    Install a package

    conda install $PACKAGE_NAME

    pip install $PACKAGE_NAME

    X

    Update a package

    conda update --name $ENVIRONMENT_NAME $PACKAGE_NAME

    pip install --upgrade $PACKAGE_NAME

    X

    Update package manager

    conda update conda

    Linux/macOS: pip install -U pip

    Win: python -m pip install -U pip

    X

    Uninstall a package

    conda remove --name $ENVIRONMENT_NAME $PACKAGE_NAME

    pip uninstall $PACKAGE_NAME

    X

    Create an environment

    conda create --name $ENVIRONMENT_NAME python

    X

    cd $ENV_BASE_DIR; virtualenv $ENVIRONMENT_NAME

    Activate an environment

    conda activate $ENVIRONMENT_NAME*

    X

    source $ENV_BASE_DIR/$ENVIRONMENT_NAME/bin/activate

    Deactivate an environment

    source deactivate

    X

    deactivate

    Search available packages

    conda search $SEARCH_TERM

    pip search $SEARCH_TERM

    X

    Install package from specific source

    conda install --channel $URL $PACKAGE_NAME

    pip install --index-url $URL $PACKAGE_NAME

    X

    List installed packages

    conda list --name $ENVIRONMENT_NAME

    pip list

    X

    Create requirements file

    conda list --export

    pip freeze

    X

    List all environments

    conda info --envs

    X

    Install virtualenv wrapper, then lsvirtualenv

    Install other package manager

    conda install pip

    pip install conda

    X

    Install Python

    conda install python=x.x

    X

    X

    Update Python

    conda update python*

    X

    X

  • 相关阅读:
    CDZSC_2015寒假新人(4)——搜索 A
    第一次组队赛---2010年全国大学生程序设计邀请赛(福州)L
    ZSC新生赛 沼跃鱼早已看穿了一切
    ZSC新生赛 聪明的员工
    CDZSC_2015寒假新人(1)——基础 I
    Linux 系统时间和硬件时间
    Python 深浅复制
    Python 函数内省
    Python 函数参数
    Python 可调用对象
  • 原文地址:https://www.cnblogs.com/jacen789/p/11440000.html
Copyright © 2011-2022 走看看