urllib3 (1.26.4) or chardet (4.0.0) doesn‘t match a supported version!

Python script execution requests dependent package warning:

C:\Python36\lib\site-packages\requests\__ init__. py:80: RequestsDependencyWarning: urllib3 (1.26.4) or chardet (4.0.0) doesn’t match a supported version! RequestsDependencyWarning)

Reason: the version of urllib3 (1.26.4) or chardet (4.0.0) in Python library is not compatible
– – – –
let’s talk about the solution first: this prompt means that the current version of urllib3 is 1.26.4 and chardet is 4.0.0__ init__ The version required in the file does not match. Follow the prompts to open the__ init__ File, line 80, you can see that there are detailed regulations for the versions of these two files, which are between the two version numbers. Here, my urllib3 or chardet is higher than the version number specified in the file, so I need to update the requests version to a higher version. Update command to   pip install upgrade requests.

Let’s talk about the background of writing this article: last week, I debugged the interface and called the requests method very smoothly. Today, when I suddenly executed this interface again, I reported the initial error. At the beginning, I didn’t know what it meant, so I went to the Internet to search, and then I started to try. For example, someone suggested using the uninstall method to unload urllib and chardet. So I just brain, regardless of all, first to unload the urllib. It’s OK to uninstall it. When I install it again, I can’t understand the error reported. Maybe the requests library can’t run normally. Well, use PIP install third party library name again     To install, who knows that my computer has turned on the agent by default when I don’t pay attention to it, so all kinds of errors that failed to install PIP pop up. There is no screenshot. The main idea is that the server host is inconsistent with the proxy host. Because of this mistake, it is another online search solution. Finally, it is found. The answer is concise and accurate. It is precisely located at the problem: the computer agent has been opened. Hurry to shut down the agent So: PIP install urllib3 is successful, PIP install upgrade requests is successful.

Time: it took me about one day to solve this problem, and finally let me solve it. It can also be regarded as a bit of harvest on the way of learning interface automation. I know how to solve this problem in the future.

Perfect, sprinkle flowers

Read More: