check_hostname requires server_hostname error when installing prodigy on work systems

Hello there,

We are trying to install Prodigy on our work systems but keep encountering the following error:

ValueError: check_hostname requires server_hostname

I have pasted the entirety of the error message at the end of this post. We have tried to install prodigy using the license code in a jupyter notebook and from the .whl file on an anaconda terminal (on windows pc), both of which have resulted in the same error.

Could you please give us some advice on what's going wrong? This is the full error message:

ERROR: Exception:
Traceback (most recent call last):
File "C:\Program Files\Anaconda\lib\site-packages\pip_internal\cli\base_command.py", line 173, in _main
status = self.run(options, args)
File "C:\Program Files\Anaconda\lib\site-packages\pip_internal\cli\req_command.py", line 203, in wrapper
return func(self, options, args)
File "C:\Program Files\Anaconda\lib\site-packages\pip_internal\commands\install.py", line 315, in run
requirement_set = resolver.resolve(
File "C:\Program Files\Anaconda\lib\site-packages\pip_internal\resolution\resolvelib\resolver.py", line 94, in resolve
result = self._result = resolver.resolve(
File "C:\Program Files\Anaconda\lib\site-packages\pip_vendor\resolvelib\resolvers.py", line 472, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "C:\Program Files\Anaconda\lib\site-packages\pip_vendor\resolvelib\resolvers.py", line 366, in resolve
failure_causes = self._attempt_to_pin_criterion(name)
File "C:\Program Files\Anaconda\lib\site-packages\pip_vendor\resolvelib\resolvers.py", line 212, in _attempt_to_pin_criterion
criteria = self._get_updated_criteria(candidate)
File "C:\Program Files\Anaconda\lib\site-packages\pip_vendor\resolvelib\resolvers.py", line 203, in _get_updated_criteria
self._add_to_criteria(criteria, requirement, parent=candidate)
File "C:\Program Files\Anaconda\lib\site-packages\pip_vendor\resolvelib\resolvers.py", line 172, in _add_to_criteria
if not criterion.candidates:
File "C:\Program Files\Anaconda\lib\site-packages\pip_vendor\resolvelib\structs.py", line 151, in bool
return bool(self._sequence)
File "C:\Program Files\Anaconda\lib\site-packages\pip_internal\resolution\resolvelib\found_candidates.py", line 140, in bool
return any(self)
File "C:\Program Files\Anaconda\lib\site-packages\pip_internal\resolution\resolvelib\found_candidates.py", line 128, in
return (c for c in iterator if id(c) not in self._incompatible_ids)
File "C:\Program Files\Anaconda\lib\site-packages\pip_internal\resolution\resolvelib\found_candidates.py", line 29, in _iter_built
for version, func in infos:
File "C:\Program Files\Anaconda\lib\site-packages\pip_internal\resolution\resolvelib\factory.py", line 272, in iter_index_candidate_infos
result = self._finder.find_best_candidate(
File "C:\Program Files\Anaconda\lib\site-packages\pip_internal\index\package_finder.py", line 851, in find_best_candidate
candidates = self.find_all_candidates(project_name)
File "C:\Program Files\Anaconda\lib\site-packages\pip_internal\index\package_finder.py", line 798, in find_all_candidates
page_candidates = list(page_candidates_it)
File "C:\Program Files\Anaconda\lib\site-packages\pip_internal\index\sources.py", line 134, in page_candidates
yield from self._candidates_from_page(self._link)
File "C:\Program Files\Anaconda\lib\site-packages\pip_internal\index\package_finder.py", line 758, in process_project_url
html_page = self._link_collector.fetch_page(project_url)
File "C:\Program Files\Anaconda\lib\site-packages\pip_internal\index\collector.py", line 490, in fetch_page
return _get_html_page(location, session=self.session)
File "C:\Program Files\Anaconda\lib\site-packages\pip_internal\index\collector.py", line 400, in _get_html_page
resp = _get_html_response(url, session=session)
File "C:\Program Files\Anaconda\lib\site-packages\pip_internal\index\collector.py", line 115, in _get_html_response
resp = session.get(
File "C:\Program Files\Anaconda\lib\site-packages\pip_vendor\requests\sessions.py", line 555, in get
return self.request('GET', url, **kwargs)
File "C:\Program Files\Anaconda\lib\site-packages\pip_internal\network\session.py", line 454, in request
return super().request(method, url, *args, **kwargs)
File "C:\Program Files\Anaconda\lib\site-packages\pip_vendor\requests\sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "C:\Program Files\Anaconda\lib\site-packages\pip_vendor\requests\sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "C:\Program Files\Anaconda\lib\site-packages\pip_vendor\cachecontrol\adapter.py", line 53, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "C:\Program Files\Anaconda\lib\site-packages\pip_vendor\requests\adapters.py", line 439, in send
resp = conn.urlopen(
File "C:\Program Files\Anaconda\lib\site-packages\pip_vendor\urllib3\connectionpool.py", line 696, in urlopen
self._prepare_proxy(conn)
File "C:\Program Files\Anaconda\lib\site-packages\pip_vendor\urllib3\connectionpool.py", line 964, in _prepare_proxy
conn.connect()
File "C:\Program Files\Anaconda\lib\site-packages\pip_vendor\urllib3\connection.py", line 359, in connect
conn = self._connect_tls_proxy(hostname, conn)
File "C:\Program Files\Anaconda\lib\site-packages\pip_vendor\urllib3\connection.py", line 500, in connect_tls_proxy
return ssl_wrap_socket(
File "C:\Program Files\Anaconda\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 "C:\Program Files\Anaconda\lib\site-packages\pip_vendor\urllib3\util\ssl
.py", line 495, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock)
File "C:\Program Files\Anaconda\lib\ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "C:\Program Files\Anaconda\lib\ssl.py", line 997, in _create
raise ValueError("check_hostname requires server_hostname")
ValueError: check_hostname requires server_hostname

hi @tahia!

Thanks for the background.

Hm... this is a bit challenging because it's not a Prodigy error, but with ssl.

After a quick google search I found other Python packages that have similar issues, especially with Windows.

In those, they mentioned:

Looks like Proxy issue, please try uninstalling any proxy software or remove proxy settings

Are you aware of any Proxy software or settings you can remove? Perhaps reach out to your IT administrator.

Yes, this would make sense. I'd suggest not trying to install via jupyter -- it's possible, but not intended for jupyter. But it seems like you had the same issue through terminal so it's likely the proxy.

Just curious - do you get the same error if you try to install any other Python packages? For example, what if you try to install spacy in the same way? If so, then this could point that it's a general problem with any Python package, not specific to Prodigy.

Not sure if it helps, but I also found this general post on ways to address this locally.

Hi Ryan,

Thank you so much for your reply. We solved a similar error while installing Spacy by changing network settings - we gave the url that we were downloading spacy from access. To my understanding, our network team gave the prodi.gy url access this time to install it, but unfortunately we're still getting this error.

My workplace does use a proxy yes and I doubt they would remove it for security reasons. Do you know of a specific url that I could suggest to the network? If they let it pass, we could download it.

Sincerely,
Tahia

Could you install Prodigy locally through the wheel file that is provided with your license? This is where companies that are in high risk environments can bring in the file and avoid needing to call out to run pip install?

Whoever is listed as the primary contact on your license gets emails with links to download the wheel files. If you have specific questions, you can also email us at contact@explosion.ai and worst case we can resend the emails.

Hi Ryan,

Thank you for your reply. I tried installing from the whl file but I got the same error:

Is there any other method I could try? Or else, yes I will email explosion.

hi @tahia,

I suspect the issue could be that when you try to install via wheel, your network's SSL is blocking the automatic install of the dependencies as well.

The problem is you will likely need to download and install each dependency one-by-one first. Then when you try to install Prodigy, use the --no-deps flag:

That link mentions the dependencies required for v1.11.14. Since then, we've released v1.12.3, which uses these dependencies:

spacy>=3.1.1,<3.7.0
wasabi>=1.1.2
srsly>=2.0.0,<3.0.0
catalogue
toolz>=0.8.2,<1.0.0
plac>=0.9.6,<1.2.0
requests
pydantic>=1.10.4,<2.0
fastapi>=0.65.1,<0.95.1
aiofiles
uvicorn>=0.13.3,<0.19.0
peewee>=3.12.0,< 3.17.0
cachetools>=4.2
pyjwt<3.0.0,>=2.0.0
uvloop<=0.14.0; python_version < "3.7" and platform_system != "Windows"
jinja2
python-dotenv>=0.21.1,<2.0.0
typeguard>=3.0.2,<4.0
tqdm>=4.38.0,<5.0.0
typing_extensions<4.6.0

Hi Ryan,

Thank you so much for your reply. The problem turned out to be in Anaconda - once we updated it, the download worked smoothly using the whl file. Thank you for your help.

Sincerely,
Tahia

1 Like