Home > Article > Backend Development > How to install libraries in python3
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.
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.
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:
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.
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!