-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValueError: check_hostname requires server_hostname #11473
Comments
Likely you broke your Anaconda base environment by using There is no guarantee that Pip will work well in Anaconda, especially the base environment. The supported way to install packages in Anaconda is using That said you will probably not have any luck installing Tensorflow in your base environment, it is a very complex package and installing it in to the base environment which is already very complex is unlikely to work. I suggest that:
|
For those landing on this issue randomly, this is likely an issue with your Python environment or an incompatibility between Anaconda Python and pip. As noted above, you should use conda for installing packages in an Anaconda environment. For maintainers: this issue can be closed as there's nothing pip can do without more context (other than raise a better error and/or provide better guidance which is already tracked in #5380. |
I will mention for those ending up here that conda and pip aren't mutually exclusive, but a few important points:
|
Absolutely, but as a broad generalisation, it's easier to not mix the two tools. In the case of this issue specifically, tensorflow is available from conda forge, so my immediate suggestion would be to use conda to install it, and not involve pip at all. And more generally, if you're thinking of using pip in a conda environment, start by asking yourself why you need to use pip, and whether it's worth the potential added complexity to do so. My understanding is that most packages are available on conda forge (possibly not the absolute latest versions, but is that crucial?) so it should be pretty rare for a conda user to actually need pip. There's a broader education point here, but I don't think it's something pip can address alone - conda users need easier access to documentation that explains how to manage packages in a conda-native way, and not end up here because they could only find advice on how to do things with pip. |
Description
I am unable to install using "pip install". I tried everything on internet but nothing worked for me.
pip install tensorflow==2.3.1 // this is I want to install
I am using jupyter notebook (python 3.10) with windows 8
Expected behavior
desired package installed.
pip version
pip 21.2.4
Python version
3.10
OS
windows
How to Reproduce
pip install tensorflow==2.3.1 ... run this
Output
ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\misbah.awan\Anaconda3\lib\site-packages\pip_internal\cli\base_command.py", line 173, in _main
status = self.run(options, args)
File "C:\Users\misbah.awan\Anaconda3\lib\site-packages\pip_internal\cli\req_command.py", line 203, in wrapper
return func(self, options, args)
File "C:\Users\misbah.awan\Anaconda3\lib\site-packages\pip_internal\commands\install.py", line 315, in run
requirement_set = resolver.resolve(
File "C:\Users\misbah.awan\Anaconda3\lib\site-packages\pip_internal\resolution\resolvelib\resolver.py", line 94, in resolve
result = self._result = resolver.resolve(
File "C:\Users\misbah.awan\Anaconda3\lib\site-packages\pip_vendor\resolvelib\resolvers.py", line 472, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "C:\Users\misbah.awan\Anaconda3\lib\site-packages\pip_vendor\resolvelib\resolvers.py", line 341, in resolve
self._add_to_criteria(self.state.criteria, r, parent=None)
File "C:\Users\misbah.awan\Anaconda3\lib\site-packages\pip_vendor\resolvelib\resolvers.py", line 172, in _add_to_criteria
if not criterion.candidates:
File "C:\Users\misbah.awan\Anaconda3\lib\site-packages\pip_vendor\resolvelib\structs.py", line 151, in bool
return bool(self._sequence)
File "C:\Users\misbah.awan\Anaconda3\lib\site-packages\pip_internal\resolution\resolvelib\found_candidates.py", line 140, in bool
return any(self)
File "C:\Users\misbah.awan\Anaconda3\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:\Users\misbah.awan\Anaconda3\lib\site-packages\pip_internal\resolution\resolvelib\found_candidates.py", line 29, in _iter_built
for version, func in infos:
File "C:\Users\misbah.awan\Anaconda3\lib\site-packages\pip_internal\resolution\resolvelib\factory.py", line 272, in iter_index_candidate_infos
result = self._finder.find_best_candidate(
File "C:\Users\misbah.awan\Anaconda3\lib\site-packages\pip_internal\index\package_finder.py", line 851, in find_best_candidate
candidates = self.find_all_candidates(project_name)
File "C:\Users\misbah.awan\Anaconda3\lib\site-packages\pip_internal\index\package_finder.py", line 798, in find_all_candidates
page_candidates = list(page_candidates_it)
File "C:\Users\misbah.awan\Anaconda3\lib\site-packages\pip_internal\index\sources.py", line 134, in page_candidates
yield from self._candidates_from_page(self._link)
File "C:\Users\misbah.awan\Anaconda3\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:\Users\misbah.awan\Anaconda3\lib\site-packages\pip_internal\index\collector.py", line 490, in fetch_page
return _get_html_page(location, session=self.session)
File "C:\Users\misbah.awan\Anaconda3\lib\site-packages\pip_internal\index\collector.py", line 400, in _get_html_page
resp = _get_html_response(url, session=session)
File "C:\Users\misbah.awan\Anaconda3\lib\site-packages\pip_internal\index\collector.py", line 115, in _get_html_response
resp = session.get(
File "C:\Users\misbah.awan\Anaconda3\lib\site-packages\pip_vendor\requests\sessions.py", line 555, in get
return self.request('GET', url, **kwargs)
File "C:\Users\misbah.awan\Anaconda3\lib\site-packages\pip_internal\network\session.py", line 454, in request
return super().request(method, url, *args, **kwargs)
File "C:\Users\misbah.awan\Anaconda3\lib\site-packages\pip_vendor\requests\sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\misbah.awan\Anaconda3\lib\site-packages\pip_vendor\requests\sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "C:\Users\misbah.awan\Anaconda3\lib\site-packages\pip_vendor\cachecontrol\adapter.py", line 53, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "C:\Users\misbah.awan\Anaconda3\lib\site-packages\pip_vendor\requests\adapters.py", line 439, in send
resp = conn.urlopen(
File "C:\Users\misbah.awan\Anaconda3\lib\site-packages\pip_vendor\urllib3\connectionpool.py", line 696, in urlopen
self._prepare_proxy(conn)
File "C:\Users\misbah.awan\Anaconda3\lib\site-packages\pip_vendor\urllib3\connectionpool.py", line 964, in _prepare_proxy
conn.connect()
File "C:\Users\misbah.awan\Anaconda3\lib\site-packages\pip_vendor\urllib3\connection.py", line 359, in connect
conn = self._connect_tls_proxy(hostname, conn)
File "C:\Users\misbah.awan\Anaconda3\lib\site-packages\pip_vendor\urllib3\connection.py", line 500, in connect_tls_proxy
return ssl_wrap_socket(
File "C:\Users\misbah.awan\Anaconda3\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:\Users\misbah.awan\Anaconda3\lib\site-packages\pip_vendor\urllib3\util\ssl.py", line 495, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock)
File "C:\Users\misbah.awan\Anaconda3\lib\ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "C:\Users\misbah.awan\Anaconda3\lib\ssl.py", line 997, in _create
raise ValueError("check_hostname requires server_hostname")
ValueError: check_hostname requires server_hostname
Code of Conduct
The text was updated successfully, but these errors were encountered: