I got two errors when I tried to install NumPy for Python3 on macOS. I've tried pip3 install numpy and a few other ways to install NumPy, and they all resulted in the same error. Here is the output:
Collecting numpy
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. (read timeout=15)")': /packages/e1/c5/65b2f257a154c7fabc1895b435e7863a1f0bb1769d3c28f1500976e090ee/numpy-1.19.5-cp39-cp39-macosx_10_9_x86_64.whl
Downloading numpy-1.19.5-cp39-cp39-macosx_10_9_x86_64.whl (15.6 MB)
ERROR: Exception:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/urllib3/response.py", line 437, in _error_catcher
yield
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/urllib3/response.py", line 519, in read
data = self._fp.read(amt) if not fp_closed else b""
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 62, in read
data = self.__fp.read(amt)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 458, in read
n = self.readinto(b)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 502, in readinto
n = self.fp.readinto(b)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socket.py", line 704, in readinto
return self._sock.recv_into(b)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 228, in _main
status = self.run(options, args)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 182, in wrapper
return func(self, options, args)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 323, in run
requirement_set = resolver.resolve(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/resolution/legacy/resolver.py", line 183, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/resolution/legacy/resolver.py", line 388, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/resolution/legacy/resolver.py", line 340, in _get_abstract_dist_for
abstract_dist = self.preparer.prepare_linked_requirement(req)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/operations/prepare.py", line 467, in prepare_linked_requirement
local_file = unpack_url(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/operations/prepare.py", line 255, in unpack_url
file = get_http_url(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/operations/prepare.py", line 129, in get_http_url
from_path, content_type = _download_http_url(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/operations/prepare.py", line 282, in _download_http_url
for chunk in download.chunks:
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/cli/progress_bars.py", line 168, in iter
for x in it:
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/network/utils.py", line 64, in response_chunks
for chunk in response.raw.stream(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/urllib3/response.py", line 576, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/urllib3/response.py", line 541, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 135, in __exit__
self.gen.throw(type, value, traceback)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/urllib3/response.py", line 442, in _error_catcher
raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
Well the logs show a timeout exception occurring while installing the module, possibly because it's quite large. What you could do is increase the timeout like so:
pip install --default-timeout=900 numpy
which should hopefully solve it.
Related
I tried installing tensorflow but I got this KeyError:
>py -3.7-64 -m pip install tensorflow
Collecting tensorflow
Downloading tensorflow-2.4.1-cp37-cp37m-win_amd64.whl (370.7 MB)
|██ | 20.2 MB 3.3 MB/s eta 0:01:47ERROR: Exception:
Traceback (most recent call last):
File "C:\...\Python37\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 171, in _merge_into_criterion
crit = self.state.criteria[name]
KeyError: 'tensorflow'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\...\Python37\lib\site-packages\pip\_vendor\urllib3\response.py", line 438, in _error_catcher
yield
File "C:\...\Python37\lib\site-packages\pip\_vendor\urllib3\response.py", line 519, in read
data = self._fp.read(amt) if not fp_closed else b""
File "C:\...\Python37\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 62, in read
data = self.__fp.read(amt)
File "C:\...\Python37\lib\http\client.py", line 461, in read
n = self.readinto(b)
File "C:\...\Python37\lib\http\client.py", line 505, in readinto
n = self.fp.readinto(b)
File "C:\...\Python37\lib\socket.py", line 589, in readinto
return self._sock.recv_into(b)
File "C:\...\Python37\lib\ssl.py", line 1071, in recv_into
return self.read(nbytes, buffer)
File "C:\...\Python37\lib\ssl.py", line 929, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\...\Python37\lib\site-packages\pip\_internal\cli\base_command.py", line 189, in _main
status = self.run(options, args)
File "C:\...\Python37\lib\site-packages\pip\_internal\cli\req_command.py", line 178, in wrapper
return func(self, options, args)
File "C:\...\Python37\lib\site-packages\pip\_internal\commands\install.py", line 317, in run
reqs, check_supported_wheels=not options.target_dir
File "C:\...\Python37\lib\site-packages\pip\_internal\resolution\resolvelib\resolver.py", line 122, in resolve
requirements, max_rounds=try_to_avoid_resolution_too_deep,
File "C:\...\Python37\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 453, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "C:\...\Python37\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 318, in resolve
name, crit = self._merge_into_criterion(r, parent=None)
File "C:\...\Python37\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 173, in _merge_into_criterion
crit = Criterion.from_requirement(self._p, requirement, parent)
File "C:\...\Python37\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 82, in from_requirement
if not cands:
File "C:\...\Python37\lib\site-packages\pip\_vendor\resolvelib\structs.py", line 124, in __bool__
return bool(self._sequence)
File "C:\...\Python37\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 143, in __bool__
return any(self)
File "C:\...\Python37\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 38, in _iter_built
candidate = func()
File "C:\...\Python37\lib\site-packages\pip\_internal\resolution\resolvelib\factory.py", line 169, in _make_candidate_from_link
name=name, version=version,
File "C:\...\Python37\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 306, in __init__
version=version,
File "C:\...\Python37\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 144, in __init__
self.dist = self._prepare()
File "C:\...\Python37\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 226, in _prepare
dist = self._prepare_distribution()
File "C:\...\Python37\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 312, in _prepare_distribution
self._ireq, parallel_builds=True,
File "C:\...\Python37\lib\site-packages\pip\_internal\operations\prepare.py", line 457, in prepare_linked_requirement
return self._prepare_linked_requirement(req, parallel_builds)
File "C:\...\Python37\lib\site-packages\pip\_internal\operations\prepare.py", line 482, in _prepare_linked_requirement
self.download_dir, hashes,
File "C:\...\Python37\lib\site-packages\pip\_internal\operations\prepare.py", line 234, in unpack_url
hashes=hashes,
File "C:\...\Python37\lib\site-packages\pip\_internal\operations\prepare.py", line 108, in get_http_url
from_path, content_type = download(link, temp_dir.path)
File "C:\...\Python37\lib\site-packages\pip\_internal\network\download.py", line 163, in __call__
for chunk in chunks:
File "C:\...\Python37\lib\site-packages\pip\_internal\cli\progress_bars.py", line 159, in iter
for x in it:
File "C:\...\Python37\lib\site-packages\pip\_internal\network\utils.py", line 88, in response_chunks
decode_content=False,
File "C:\...\Python37\lib\site-packages\pip\_vendor\urllib3\response.py", line 576, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "C:\...\Python37\lib\site-packages\pip\_vendor\urllib3\response.py", line 541, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "C:\...\Python37\lib\contextlib.py", line 130, in __exit__
self.gen.throw(type, value, traceback)
File "C:\...\Python37\lib\site-packages\pip\_vendor\urllib3\response.py", line 443, in _error_catcher
raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
Then I tried installing it using a virtual environment (venv), and the progress bar went a bit further this time, but it still threw pretty much the same error.
Any ideas how to fix this?
Thanks.
Just use --default-timeout=100 parameter with the install. e.g
py -3.7-64 -m pip install --default-timeout=100 tensorflow
I hope, this will help you.
I've tried a lot of methods but useless. Finally I have to reinstalled my python and it works.
I use spacy to do some NLP tasks but every time I try to download the word embbeding model from spacy
fr_core_news_lg,
there is:
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred
This error stops the model download execution.
(base) C:\Users\marct>python -m spacy download fr_core_news_lg
Collecting fr_core_news_lg==2.3.0 from https://github.com/explosion/spacy-models/releases/download/fr_core_news_lg-2.3.0/fr_core_news_lg-2.3.0.tar.gz#egg=fr_core_news_lg==2.3.0
Downloading https://github.com/explosion/spacy-models/releases/download/fr_core_news_lg-2.3.0/fr_core_news_lg-2.3.0.tar.gz (572.0MB)
85% |███████████████████████████ | 487.3MB 27kB/s eta 0:52:09Exception:
Traceback (most recent call last):
File "C:\Users\marct\Anaconda3\lib\site-packages\pip\_vendor\urllib3\response.py", line 360, in _error_catcher
yield
File "C:\Users\marct\Anaconda3\lib\site-packages\pip\_vendor\urllib3\response.py", line 442, in read
data = self._fp.read(amt)
return self._sslobj.read(len, buffer)
File "C:\Users\marct\Anaconda3\lib\ssl.py", line 631, in read
v = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\marct\Anaconda3\lib\site-packages\pip\_internal\cli\base_command.py", line 179, in main
status = self.run(options, args)
File "C:\Users\marct\Anaconda3\lib\site-packages\pip\_internal\download.py", line 946, in _download_http_url
_download_url(resp, link, content_file, hashes, progress_bar)
File "C:\Users\marct\Anaconda3\lib\site-packages\pip\_internal\download.py", line 641, in _download_url
consume(downloaded_chunks)
File "C:\Users\marct\Anaconda3\lib\site-packages\pip\_internal\utils\misc.py", line 914, in consume
deque(iterator, maxlen=0)
File "C:\Users\marct\Anaconda3\lib\site-packages\pip\_internal\download.py", line 607, in written_chunks
for chunk in chunks:
File "C:\Users\marct\Anaconda3\lib\site-packages\pip\_internal\utils\ui.py", line 159, in iter
for x in it:
File "C:\Users\marct\Anaconda3\lib\site-packages\pip\_internal\download.py", line 596, in resp_read
decode_content=False):
File "C:\Users\marct\Anaconda3\lib\site-packages\pip\_vendor\urllib3\response.py", line 494, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "C:\Users\marct\Anaconda3\lib\site-packages\pip\_vendor\urllib3\response.py", line 459, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "C:\Users\marct\Anaconda3\lib\contextlib.py", line 99, in __exit__
self.gen.throw(type, value, traceback)
File "C:\Users\marct\Anaconda3\lib\site-packages\pip\_vendor\urllib3\response.py", line 365, in _error_catcher
raise ReadTimeoutError(self._pool, None, 'Read timed out.')
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='github-production-release-asset-2e65be.s3.amazonaws.com', port=443): Read timed out.
If there is someone who can help me with the problem.
Thank you in advance
When try I to install tensorflow using pip like this
pip install tensorflow
It gives me the following error:
Collecting tensorflow
Downloading tensorflow-2.3.1-cp38-cp38-win_amd64.whl (342.5 MB)
| | 3.4 MB 12 kB/s eta 7:44:02ERROR: Exception:
Traceback (most recent call last):
File "c:\users\win 10\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\urllib3\response.py", line 437, in _error_catcher
yield
File "c:\users\win 10\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\urllib3\response.py", line 519, in read
data = self._fp.read(amt) if not fp_closed else b""
File "c:\users\win 10\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 62, in read
data = self.__fp.read(amt)
File "c:\users\win 10\appdata\local\programs\python\python38\lib\http\client.py", line 458, in read
n = self.readinto(b)
File "c:\users\win 10\appdata\local\programs\python\python38\lib\http\client.py", line 502, in readinto
n = self.fp.readinto(b)
File "c:\users\win 10\appdata\local\programs\python\python38\lib\socket.py", line 669, in readinto
return self._sock.recv_into(b)
File "c:\users\win 10\appdata\local\programs\python\python38\lib\ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "c:\users\win 10\appdata\local\programs\python\python38\lib\ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\win 10\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\cli\base_command.py", line 228, in _main
status = self.run(options, args)
File "c:\users\win 10\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\cli\req_command.py", line 182, in wrapper
return func(self, options, args)
File "c:\users\win 10\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\commands\install.py", line 323, in run
requirement_set = resolver.resolve(
File "c:\users\win 10\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 183, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "c:\users\win 10\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 388, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "c:\users\win 10\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 340, in _get_abstract_dist_for
abstract_dist = self.preparer.prepare_linked_requirement(req)
File "c:\users\win 10\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\operations\prepare.py", line 467, in prepare_linked_requirement
local_file = unpack_url(
File "c:\users\win 10\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\operations\prepare.py", line 255, in unpack_url
file = get_http_url(
File "c:\users\win 10\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\operations\prepare.py", line 129, in get_http_url
from_path, content_type = _download_http_url(
File "c:\users\win 10\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\operations\prepare.py", line 282, in _download_http_url
for chunk in download.chunks:
File "c:\users\win 10\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\cli\progress_bars.py", line 168, in iter
for x in it:
File "c:\users\win 10\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\network\utils.py", line 64, in response_chunks
for chunk in response.raw.stream(
File "c:\users\win 10\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\urllib3\response.py", line 576, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "c:\users\win 10\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\urllib3\response.py", line 541, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "c:\users\win 10\appdata\local\programs\python\python38\lib\contextlib.py", line 131, in __exit__
self.gen.throw(type, value, traceback)
File "c:\users\win 10\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\urllib3\response.py", line 442, in _error_catcher
raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
What does the error means and how can I install it?
And if I do a google search on how to install tensorflow it tells me to download it from a virtual environment, I don't know how to create virtual environment
As commented by #Dr. Snoopy, error looks like connection issue.
Tensorflow 2.2 or later versions requires Python 3.8.For more please go through official website of Tensorflow.
As suggested by #Raghav Gupta, conda takes care of package versions incompatibility.
conda create --name tf python=3.8 tensorflow #install python 3.8 and latest version of Tensorflow
I am installing this on anaconda and python ide too but getting the same error tried adjusting paths too.
Downloading opencv_python-4.4.0.42-cp37-cp37m-win_amd64.whl (33.5 MB)
|█████ | 5.3 MB 40 kB/s eta 0:11:43ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\Uma sri\anaconda3\lib\site-packages\pip\_vendor\urllib3\response.py", line 425, in _error_catcher
yield
File "C:\Users\Uma sri\anaconda3\lib\site-packages\pip\_vendor\urllib3\response.py", line 507, in read
data = self._fp.read(amt) if not fp_closed else b""
File "C:\Users\Uma sri\anaconda3\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 62, in read
data = self.__fp.read(amt)
File "C:\Users\Uma sri\anaconda3\lib\http\client.py", line 457, in read
n = self.readinto(b)
File "C:\Users\Uma sri\anaconda3\lib\http\client.py", line 501, in readinto
n = self.fp.readinto(b)
File "C:\Users\Uma sri\anaconda3\lib\socket.py", line 589, in readinto
return self._sock.recv_into(b)
File "C:\Users\Uma sri\anaconda3\lib\ssl.py", line 1071, in recv_into
return self.read(nbytes, buffer)
File "C:\Users\Uma sri\anaconda3\lib\ssl.py", line 929, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Uma sri\anaconda3\lib\site-packages\pip\_internal\cli\base_command.py", line 186, in _main
status = self.run(options, args)
File "C:\Users\Uma sri\anaconda3\lib\site-packages\pip\_internal\commands\install.py", line 331, in run
resolver.resolve(requirement_set)
File "C:\Users\Uma sri\anaconda3\lib\site-packages\pip\_internal\legacy_resolve.py", line 177, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "C:\Users\Uma sri\anaconda3\lib\site-packages\pip\_internal\legacy_resolve.py", line 333, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "C:\Users\Uma sri\anaconda3\lib\site-packages\pip\_internal\legacy_resolve.py", line 282, in _get_abstract_dist_for
abstract_dist = self.preparer.prepare_linked_requirement(req)
File "C:\Users\Uma sri\anaconda3\lib\site-packages\pip\_internal\operations\prepare.py", line 482, in prepare_linked_requirement
hashes=hashes,
File "C:\Users\Uma sri\anaconda3\lib\site-packages\pip\_internal\operations\prepare.py", line 287, in unpack_url
hashes=hashes,
File "C:\Users\Uma sri\anaconda3\lib\site-packages\pip\_internal\operations\prepare.py", line 159, in unpack_http_url
link, downloader, temp_dir.path, hashes
File "C:\Users\Uma sri\anaconda3\lib\site-packages\pip\_internal\operations\prepare.py", line 303, in _download_http_url
for chunk in download.chunks:
File "C:\Users\Uma sri\anaconda3\lib\site-packages\pip\_internal\utils\ui.py", line 160, in iter
for x in it:
File "C:\Users\Uma sri\anaconda3\lib\site-packages\pip\_internal\network\utils.py", line 39, in response_chunks
decode_content=False,
File "C:\Users\Uma sri\anaconda3\lib\site-packages\pip\_vendor\urllib3\response.py", line 564, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "C:\Users\Uma sri\anaconda3\lib\site-packages\pip\_vendor\urllib3\response.py", line 529, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "C:\Users\Uma sri\anaconda3\lib\contextlib.py", line 130, in __exit__
self.gen.throw(type, value, traceback)
File "C:\Users\Uma sri\anaconda3\lib\site-packages\pip\_vendor\urllib3\response.py", line 430, in _error_catcher
raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
The Anaconda installer is trying to establish a connection to download the packages, however it is failing to do so. Please check your internet connection and try re-installing.
I am actively trying to get into machine learning, but while i was trying to install tensor flow on my system it kept giving me errors. I am using python 3.7.3 64bit for windows. I have tried different means to install it with no progress. This is the error below,help will be appreciated
ERROR: Exception:
Traceback (most recent call last):
File "c:\users\ishola taofeek\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\urllib3\response.py", line 425, in _error_catcher
yield
File "c:\users\ishola taofeek\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\urllib3\response.py", line 507, in read
data = self._fp.read(amt) if not fp_closed else b""
File "c:\users\ishola taofeek\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 62, in read
data = self.__fp.read(amt)
File "c:\users\ishola taofeek\appdata\local\programs\python\python37\lib\http\client.py", line 447, in read
n = self.readinto(b)
File "c:\users\ishola taofeek\appdata\local\programs\python\python37\lib\http\client.py", line 491, in readinto
n = self.fp.readinto(b)
File "c:\users\ishola taofeek\appdata\local\programs\python\python37\lib\socket.py", line 589, in readinto
return self._sock.recv_into(b)
File "c:\users\ishola taofeek\appdata\local\programs\python\python37\lib\ssl.py", line 1052, in recv_into
return self.read(nbytes, buffer)
File "c:\users\ishola taofeek\appdata\local\programs\python\python37\lib\ssl.py", line 911, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\ishola taofeek\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\cli\base_command.py", line 186, in _main
status = self.run(options, args)
File "c:\users\ishola taofeek\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\commands\install.py", line 331, in run
resolver.resolve(requirement_set)
File "c:\users\ishola taofeek\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\legacy_resolve.py", line 177, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "c:\users\ishola taofeek\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\legacy_resolve.py", line 333, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "c:\users\ishola taofeek\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\legacy_resolve.py", line 282, in _get_abstract_dist_for
abstract_dist = self.preparer.prepare_linked_requirement(req)
File "c:\users\ishola taofeek\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\operations\prepare.py", line 482, in prepare_linked_requirement
hashes=hashes,
File "c:\users\ishola taofeek\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\operations\prepare.py", line 287, in unpack_url
hashes=hashes,
File "c:\users\ishola taofeek\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\operations\prepare.py", line 159, in unpack_http_url
link, downloader, temp_dir.path, hashes
File "c:\users\ishola taofeek\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\operations\prepare.py", line 303, in _download_http_url
for chunk in download.chunks:
File "c:\users\ishola taofeek\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\utils\ui.py", line 160, in iter
for x in it:
File "c:\users\ishola taofeek\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\network\utils.py", line 39, in response_chunks
decode_content=False,
File "c:\users\ishola taofeek\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\urllib3\response.py", line 564, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "c:\users\ishola taofeek\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\urllib3\response.py", line 529, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "c:\users\ishola taofeek\appdata\local\programs\python\python37\lib\contextlib.py", line 130, in __exit__
self.gen.throw(type, value, traceback)
File "c:\users\ishola taofeek\appdata\local\programs\python\python37\lib\site-packages\pip\_vendor\urllib3\response.py", line 430, in _error_catcher
raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
As mentioned in this Question.
pip has an default timeout of 15 sec. When trying to install a big file (especially when using slow wifi), this may not be enough.. To fix this just set pip to take longer (for example 1000 sec).
pip install --default-timeout=1000 install tensorflow
Something went wrong when trying to download a certain file (for chunk in download.chunks: gives the hint). In short, you have internet issues. Could be a lot.