Pyton - 包管理Anaconda 和 PIP
Anaconda
- Common Commands
-
conda info & condaupdate conda
-
conda install/update scikit-learn
- conda install --insecure
- conda install scipy --channel conda-forge
- conda install matplotlib=3.0.0
-
conda create --name/-n py35 python=3.5
-
activate/deactivate py35/base
-
conda env list
-
conda list/search
-
conda list -e > requirements.txt
-
conda install --yes --file requirements.txt
- check packages dependencies: conda info package name
-
Add channels
-
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 conda-forg
anaconda: anaconda.org - a mirror of the packages available in main, free, and pro hosted on repo.anaconda.comconda-forge: A community led collection of recipes, build infrastructure and distributions for the conda package manager.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.biocond: specializing in bioinformatics softwaredefaults- conda config --set show_channel_urls yes
- Tricks
PYPI
- Common Commands
- pip install scikit-learn
- pip uninstall scikit-learn
- pip --version/-V
- pip list
- pip install scikit-learn-1.0-py2.py3-none-any.whl
- pip show --files scikit-learn
- pip install --upgrade/-U scikit-learn
- .python -m pip install scikit-learn
- python -m pip install --upgrade pip
Mixed PIP & Conda
- Conda first, then PIP
- conda isolate the pip,be careful with the sudopip
-
Rebuild the conda Env if needed
-
Save the conda andpip requirement files

浙公网安备 33010602011771号