1
File "...\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\urllib3\connection.py", line 500, in _connect_tls_proxy
return ssl_wrap_socket(
File "...\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\urllib3\util\ssl_.py", line 453, in ssl_wrap_socket
ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls)
File "...\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\urllib3\util\ssl_.py", line 495, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock) 
File "...\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 512, in wrap_socket
return self.sslsocket_class._create(
File "...\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 1027, in _create
raise ValueError("check_hostname requires server_hostname")
ValueError: check_hostname requires server_hostname

Whatever I am trying - pip returns the same error message. And I am having a hard time tracking down the cause of this problem.

Environment: Windows 10 (latest build), Proxy. Proxy is set (also in the variables). And it works. Moreover, i wrote a simple python program retrieving the web page using urllib's request - and it works over this proxy server.

I've tried to force proxy in pip via command line, i've tried to use all these trusted-host parameters - everything fails. I reinstalled python directly from the web page. Nothing.

What's stranger - the very same proxy works flawlessly on linux systems. F.e. command:

pip3 install panda --proxy http://192.168.100.30:8088

Does work on Linux (same subnet, same proxy, same firewall), but fails on each Windows (i've tried the other systems) i try. This would mean that I am still missing some proxy settings on the Windows machine. But which? And why requests within python environment have no issues at all with the proxy?

6
  • Different pip --version on both systems? Commented Nov 2, 2021 at 8:47
  • Good point. I Upgraded the version on linux. 21.3.1. Still works. On WIndows I have version from installer - 21.2.3. Can't upgrade becase of the problem mentioned above. But this difference should be an issue. Commented Nov 2, 2021 at 9:12
  • Upgrade pip via a wheel: stackoverflow.com/a/68945239/7976758 Commented Nov 2, 2021 at 9:15
  • Strange. I did upgrade via wheel. Now I do have the same version, but different error: WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000002BED44E9750>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))': /simple/django/ Commented Nov 2, 2021 at 9:44
  • 1
    That's what I thought, but oddly no problems at all using web pages, downloading pages using urllib, also many other package managers work fine. I use the very same DNS settings on my linux machines. But I'll try to dig in this direction. Anyway I was able to install what I needed using downloaded wheels, so i'ts not so urgent anymore. Commented Nov 3, 2021 at 6:58

3 Answers 3

2

Run the same command pip3 install panda --proxy http://192.168.100.30:8088 on windows, but before that, make sure no proxy is selected. You can do that by going to Internet Explorer >> Settings >> Internet Options >> Connections >> Lan Settings and unchecking all three checkboxes

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

2

I also got the same error(pip, windows).

ValueError: check_hostname requires server_hostname

For those of you who have your VPN turned on, try to close the VPN and run the same command again. This solved my problem. Hope this helps

Comments

0

i had this problem. you should turn off your vpn .

2 Comments

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
This appears to be the same suggestion as a previous answer; if you are suggesting something different, please clarify.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.