Python has a powerful third-party library with a large number and powerful capabilities. PIP is a package management tool that you can use to
Install, upgrade, uninstall various third-party libraries.
Because my system is Linux, the above also exists Python2 and Python3, which need to install PIP3
Once the installation is complete, you can install a third-party library,
To install the requests library as an example
Be aware of permissions issues before installing
Then try to import the requests library in the Python shell, directly error (╯-╰)
You can see that the requests Library is indeed installed,
Here you can basically determine that Python cannot find the requests library from the path
As you can see, Sys.path does not contain the path to the requests library.
Here I think of the previous custom installation of Python, the path is their own choice (╯-╰)
Modify Sys.path
Then import the requests library and successfully
However, there is a question as to why importing a library directly into the library name
When importing a package, you need to import the package name. Module Name
Python install pip