How to install libraries in python, how to install libraries in python

Hello everyone, let me share with you where to put the python external library after installation. Many people don't know this yet. Explain in detail below. Let's see now!

Python has become one of the most popular languages. In addition to its ease of learning and simple syntax, another important reason is that Python has very powerful third-party libraries. The third-party library is not an official built-in library, but provided by a large number of developers in the community. According to statistics, the number of third-party libraries has exceeded 100,000 . In this lesson, we will talk about how to install third-party libraries, and use three third-party libraries to explain how to use third-party libraries.

First, the installation method of the third-party library

There are three ways to install third-party libraries: pip installation, custom installation, and file installation. Pip installation is the most commonly used installation method, and the prerequisite for using it is that the computer must be connected to the Internet.

Here we focus on the method of pip installation. The pip command is a built-in command of Python. The pip command needs to be run in the Windows command prompt window or the terminal of the Linux or MAC OS system. Since there may be two versions of Python 2 and Python 3 in Linux and MAC OS systems, it is recommended to use the special pip3 command to install.

Execute the pip -h command to view the commonly used subcommands of pip.

a897e0d05a154d238b7ac98fa47a067e.png

Let's take a look at the commonly used subcommands:

        pip install: install third-party libraries

        pip uninstall: Uninstall installed third-party libraries

        pip list: list the installed third-party libraries

        pip show: Display information about installed third-party libraries

        pip download: download third-party libraries, but do not install them

 Let's take pip install as an example to see how to install the jieba library:

pip install jieba

Guess you like

Origin blog.csdn.net/mynote/article/details/132204193