The method of installation dependencies python

Some of the common ways Python Package

1). Pip installation (normal line installation)

2). Whl installation (offline installation), the packet format is generally .whl

3). Installation source (off-line installation), tar.gz / egg format

4). Easy_install installation (with less)

Different mounting installation steps

. 1) pip is a generic Python package management tools; provide a Python package to find, download, install, uninstall feature, use pip installation package will automatically install other packages depend, without having to install it manually.

    >  Pip pip install --upgrade   (pip first upgrade to the latest version) 

    >  PIP the install XXX   (python installation package format)

2) The upper wheel is essentially a zip files or rar, but he is more convenient to install and use python. How to install the package .whl format? It must first clear why use whl, because sometimes the official python package does not provide the right solution when, this time forced to adopt whl way to install, and look to see how to use whl installation package required.

    (1) Determine the version of Python

    (2) Found .whl packet format corresponding to the version from the Python domestic source image repository, downloaded to the local

         >  PIP xxx.whl the install   (download format .whl package into the current directory of the downloaded package; means that a particular path that is xxx.whl .whl package is located)

3). Source installation is in the case described above will not work, only the source code, you can manually install yourself, essential skills, general python third-party packages, will provide manual installation mode, there will be a general setup.py directory for the file from the source installation's ability to download the source code to be installed into the current download a good source packages

    >  Python setup.py the install    (installable format)

python  commonly used several mirrors warehouse

Python official source:  pypi.python.org/pypi/

Watercress: http://pypi.douban.com/simple/

          https://pypi.douban.com/simple/
Tsinghua: https://pypi.tuna.tsinghua.edu.cn/simple

University of California: https://www.lfd.uci.edu/~gohlke/pythonlibs/

China University of Science and Technology: https://mirrors.ustc.edu.cn/pypi/web/simple 

Ali: https://mirrors.aliyun.com/pypi/simple/

【supplement】:

Python versions Download:

Official Address: https://www.python.org/downloads/

Anaconda versions Download:

Official Address: https://repo.anaconda.com/archive/

Tsinghua Mirror: https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/

Python a method of key installation of all dependencies

Pros: requires only a simple command to complete pip (when more python installation package, do not have to manually download and install one by one)

. 1) python a key generating dependencies: (requirements.txt used to record programs of all dependencies and version number)

    > pip freeze >requirements.txt

2) .python a key installation time installation dependencies :( requirements.txt inside all dependencies)

  pip install -r requirements.txt

Guess you like

Origin www.cnblogs.com/adret/p/12305916.html