[Solved] ValueError: check_hostname requires server_hostname

The newly built python environment reports an error when running:ValueError: check_hostname requires server_hostname

reason

  • Every time you use the pip install command to download a plug-in, the latest version is downloaded
  • Download the requests plugin, it will automatically install the dependent urllib3 plugin
  • Then the version of the dependent plug-in is too high, which leads to this error problem

solve

  • When installing requests, directly choose to use the lower version
    • pip install requests==2.20
  • Or lower the urllib3 version
    • pip install urllib3==1.25.8

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *