Pyton - 包管理Anaconda 和 PIP

Anaconda

  1. Common Commands
    1.  conda info & condaupdate conda

    2. conda install/update scikit-learn

      1. conda install --insecure
      2. conda install scipy --channel conda-forge
      3. conda install matplotlib=3.0.0
    3. conda create --name/-n py35 python=3.5

    4. activate/deactivate py35/base

    5. conda env list

    6. conda list/search

    7. conda list -e > requirements.txt

    8. conda install --yes --file requirements.txt

    9. check packages dependencies: conda info package name
    10. Add channels

      1. conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

      2. conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/

      3. conda config --add channels conda-forg
        1. anaconda: anaconda.org - a mirror of the packages available in main, free, and pro hosted on repo.anaconda.com
        2. conda-forge: A community led collection of recipes, build infrastructure and distributions for the conda package manager.
        3. r: Microsoft R Open conda packages and Anaconda, Inc.’s R conda packages. This channel is included in conda’s “defaults” channel. When creating new environments, MRO is now chosen as the default R implementation.
        4. biocond: specializing in bioinformatics software
        5. defaults
      1. conda config --set show_channel_urls yes
  2. Tricks
    1. SSL error

PYPI

  1. Common Commands
    1. pip install scikit-learn
    2. pip uninstall scikit-learn
    3. pip --version/-V
    4. pip list
    5. pip install scikit-learn-1.0-py2.py3-none-any.whl
    6. pip show --files scikit-learn
    7. pip install --upgrade/-U scikit-learn
    8. .python -m pip install scikit-learn
    9. python -m pip install --upgrade pip

Mixed PIP & Conda

  1. Conda first, then PIP
  2.  conda isolate the pip,be careful with the sudopip
  3. Rebuild the conda Env if needed

  4. Save the conda andpip requirement files

Refer to

  1. Tensor

Visual Code settings

posted @ 2019-10-13 09:48  yousoluck  阅读(252)  评论(0)    收藏  举报