Python install pip

Source: Internet
Author: User

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

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.