4 ways to install third-party libraries in Python

Source: Internet
Author: User

4 ways to install third-party libraries in Python 1, use Pip

Most libraries can be installed via PIP, installed by, in the Command Line window input: Pip install Libname

libname-for the library name

Some libraries cannot be installed via Pip, possibly because they are not packaged and uploaded to PyPI, and can be installed offline after downloading the installation package by: Pip Install LibPath

Libpath-is the address for the local installation package, which is typically suffixed with WHL. Represents a binary file in the Windows environment of a Python expansion pack. There is a special place to download this kind of file. http://www.lfd.uci.edu/~gohlke/pythonlibs/, which was created by the University of California's teachers and students for the convenience of Python users, is not available for use and is at its own risk.

Notes

    • If you need to specify the version of the third-party library installation package, use the command: Pip install libname = = 2.3.5 this way;
    • Pip online installation, the default is the latest third-party library installed on the Internet, if the third-party library updated, will follow the new.
2, the use of Setuptools source file installation

If the downloaded installation package is a compressed package with a source file, after decompression, run setup.py to install it by:

Command line switch to the directory where the setup.py file is located in the installation package, execute the python setup.py install

Notes

    • Before installing, make sure you have installed the Toolkit Setuptools, Kit: Https://pypi.python.org/pypi/setuptools
3. Run the installation package

Some class libraries provide a double-click to run a direct install of the installation package, such as Python-connected MySQL database driver Mysql-connector-python

These installation packages have a suffix called msi or EXE. After the download, double-click to install the installation, if you want to according to the version of Python and the number of bits of Windows to download the corresponding installation package, or the installation process will be error or direct prompt cannot be installed.

4, the use of pycharm for installation

1) Open Pycharm

2) Open the Setting menu under the File menu

3) Select Project interpreter under Project:python under Settings and select Python version, point right + Enter the third-party library's search interface

4) Enter the name of the third-party package to be installed in the search interface of the third-party package, click the Install Packages button in the lower left corner, and then prompt the installation to succeed.

Notes

    • Note: This method can specify the corresponding version of the installation, if not specified, the default installation is up-to-date.

Part of the method is also based on personal experience, if the article has the wrong place, also please correct me, timely with the new, thank you! ***

4 ways to install third-party libraries in Python

Related Article

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.