Home >Backend Development >Python Tutorial >How to install libraries in python3

How to install libraries in python3

(*-*)浩
(*-*)浩Original
2019-08-01 15:51:413618browse

The python language is famous for its third-party libraries. It is precisely because of the rich third-party libraries that the rich functions of python can be realized. Let's take a look at how to install third-party libraries in python.

How to install libraries in python3

pip installation is the simplest mode of installing third-party libraries in Python. To use pip for online installation, we must ensure two basic The conditions are:

1. The machine to be installed can connect to the external network (recommended learning: Python video tutorial)

2. Know the name of the third-party library

First look at the first condition to ensure that it can connect to the external network. The most commonly used method is to ping Baidu official website, as shown in the figure below, it can work normally Just respond.

How to install libraries in python3

The second condition is to know the name of the python third-party library. For example, if I want to install the Django development module, the installation command is:

pip install Django

As shown below As shown in, pip will automatically download the Django installation package from the default source location, and then start the installation:

How to install libraries in python3

After the installation is completed, the words "succesfully installed" will be prompted, and then we open python From the command line, try importing the module. If there are no errors during the installation process and the import process is normal, as shown in the second picture below. This means that the third-party module is successfully installed.
How to install libraries in python3

For more Python related technical articles, please visit the Python Tutorial column to learn!

The above is the detailed content of How to install libraries in python3. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn