Resolve – keyerror encountered while installing tensorflow GPU: ‘tensorflow’ error


1. Error content

the error is as follows (example):

ERROR: Exception:
Traceback (most recent call last):
  File "/home/guest/anaconda3/envs/tf_1.8/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 171, in _merge_into_criterion
    crit = self.state.criteria[name]
KeyError: 'numpy'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/guest/anaconda3/envs/tf_1.8/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py", line 438, in _error_catcher
    yield
  File "/home/guest/anaconda3/envs/tf_1.8/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py", line 519, in read
    data = self._fp.read(amt) if not fp_closed else b""
  File "/home/guest/anaconda3/envs/tf_1.8/lib/python3.6/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 62, in read
    data = self.__fp.read(amt)
  File "/home/guest/anaconda3/envs/tf_1.8/lib/python3.6/http/client.py", line 463, in read
    n = self.readinto(b)
  File "/home/guest/anaconda3/envs/tf_1.8/lib/python3.6/http/client.py", line 507, in readinto
    n = self.fp.readinto(b)
  File "/home/guest/anaconda3/envs/tf_1.8/lib/python3.6/socket.py", line 586, in readinto
    return self._sock.recv_into(b)
  File "/home/guest/anaconda3/envs/tf_1.8/lib/python3.6/ssl.py", line 1012, in recv_into
    return self.read(nbytes, buffer)
  File "/home/guest/anaconda3/envs/tf_1.8/lib/python3.6/ssl.py", line 874, in read
    return self._sslobj.read(len, buffer)
  File "/home/guest/anaconda3/envs/tf_1.8/lib/python3.6/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 "/home/guest/anaconda3/envs/tf_1.8/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 189, in _main
    status = self.run(options, args)
  File "/home/guest/anaconda3/envs/tf_1.8/lib/python3.6/site-packages/pip/_internal/cli/req_command.py", line 178, in wrapper
    return func(self, options, args)
  File "/home/guest/anaconda3/envs/tf_1.8/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 317, in run
    reqs, check_supported_wheels=not options.target_dir
  File "/home/guest/anaconda3/envs/tf_1.8/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 122, in resolve
    requirements, max_rounds=try_to_avoid_resolution_too_deep,
  File "/home/guest/anaconda3/envs/tf_1.8/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 453, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/home/guest/anaconda3/envs/tf_1.8/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 347, in resolve
    failure_causes = self._attempt_to_pin_criterion(name, criterion)
  File "/home/guest/anaconda3/envs/tf_1.8/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 207, in _attempt_to_pin_criterion
    criteria = self._get_criteria_to_update(candidate)
  File "/home/guest/anaconda3/envs/tf_1.8/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 199, in _get_criteria_to_update
    name, crit = self._merge_into_criterion(r, parent=candidate)
  File "/home/guest/anaconda3/envs/tf_1.8/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 173, in _merge_into_criterion

2. Solutions

the input code is as follows:

pip install tensorflow-gpu==1.8.0 --default-timeout=10000 --upgrade

Summary

accumulate more in peacetime and make fewer mistakes in wartime! It’s over

Read More: