`ValueError: check_hostname requires server_hostname` occurs when installing matplotlib using pip

Question:

Some erros returned when I tried to install matplotlib in cmd.
Version of pip is 21.2.3.
Version of python is 3.10.0
I also tried to install it in pycharm.But failed again.
I don’t know how to solve this problem.

This is my command in cmd: pip install matplotlib

there is the output when I executed my command.

raise ValueError("check_hostname requires server_hostname")
ValueError: check_hostname requires server_hostname
Asked By: echo

||

Answers:

There might be some compatibility issues with python 3.10 and matplotlib right now. I found some similar issues Here. Hopefully, they will be fixed with time. For the time you might try to create a python 3.8/3.9 environment and pip install a compatible matplotlib without much trouble. I usually prefer the Anaconda python distribution when working in windows since it comes with numpy, matplotlib, pandas etc. modules out of the box.

Answered By: Suhail Najeeb