The simplest way to install third-party libraries in Python

Source: Internet
Author: User

First, the preparatory work

(It will be convenient to do only one preparation work)

1. Install Pip

(1) Download Pip to D:\download

Pip:https://pypi.python.org/pypi/pip#downloads

(2) Extract to the current directory after downloading;

(3) "win+r" into cmd; Enter the following code, in turn:

C:\USERS\ADMINISTRATOR>CD D:\download\pip-9.0.1C:\Users\Administrator>D:
D:\download\pip-9.0.1>python setup.py Install

(4) Configure environment variables:

Add the installation path to the PIP in path: The script folder under the Python installation path

(5) Complete

Re-"win+r" into CMD; run the following code directly:

Run: Pip-v or Pip--version, showing the version information of the PIP

2. Installing Wheel

(For offline installation of downloaded WHL files)

"Win+r" into CMD; run the following code directly:

Pip Install Wheel
Ii. installation of third-party libraries

1. Online Installation

Run directly in the CMD window: Pip install package name, such as Pip install requests

Note: This method will automatically download the third-party library, after the installation is completed and will not be deleted, if you want to delete the default download path to it manually deleted;

Win7 default path://AppData may be the default path for the hidden folder \ \ user \ (your user name) \appdata\local\pip\cachelinux:~/.cache /pip

In fact, there is no need to delete the cache, add--no-cache-dir can disable caching

2. Offline installation

(1) Download

In http://www.lfd.uci.edu/~gohlke/pythonlibs/download the. whl file for the required library, note that the cp** in the file name should match the installed version. If you install Python2.7, you should download the corresponding cp27. WHL file

(2) Installation

Run: Pip install **.WHL, if wheel is installed.

3. Unzip the installation

Rename the. WHL suffix to zip, unzip, and put the extracted folder into the python/lib/site-packages.

The simplest way to install third-party libraries in Python

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.