Pycharm cannot import the third-party library no module named urllib3

Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>

Urllib3 is a powerful, well-organized Python library for HTTP clients. If we find that urllib3 library cannot be used in the new project created by pychar editor, we can do the following operations:

The error is as follows:

We can’t find this urllib3 file in the site packages of Lib in pychar project

So, let’s continue:

1. First confirm whether urllib3 has been installed on the computer. If not, install urllib3 through PIP install urllib3 in the CMD command

If the installation is successful, the URL lib3 folder will exist in lib/site packages in the python program installation directory. For example, the address on my side is: C:: (users, administrator, appdata, local programs, python, python37, lib, site packages, urlib3

2. When creating a new program, check inherit global package. Inherit global site-packages

3. At this time, we can see the class package of the project

At this time, we can find that there is one more class package. There are two site packages in total

Open the last site packages, and you can see that urllib3 is imported successfully

Then let’s look at the code:

There’s no red wavy line

Similar Posts: