0

I tried to install TensorFlow using pip install tensorflow and I got the below error. Is that because of a timeout problem? How to overcome this error when installing TensorFlow?

ERROR: Exception:
Traceback (most recent call last):
  File "c:\users\hp\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\urllib3\response.py", line 425, in _error_catcher
    yield
  File "c:\users\hp\appdata\local\programs\python\python38\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\hp\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\hp\appdata\local\programs\python\python38\lib\http\client.py", line 454, in read
    n = self.readinto(b)
  File "c:\users\hp\appdata\local\programs\python\python38\lib\http\client.py", line 498, in readinto
    n = self.fp.readinto(b)
  File "c:\users\hp\appdata\local\programs\python\python38\lib\socket.py", line 669, in readinto
    return self._sock.recv_into(b)
  File "c:\users\hp\appdata\local\programs\python\python38\lib\ssl.py", line 1241, in recv_into
    return self.read(nbytes, buffer)
  File "c:\users\hp\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
1
  • 1
    are you using a conda environment? if not try: pip --default-timeout=300 install tensorflow Commented Nov 16, 2020 at 3:53

2 Answers 2

2

if you are using conda first run:

conda config --set ssl_verify no

after that modify your default timeout:

pip --default-timeout=900 install tensorflow 

Note: conda config --set ssl_verify no only applicable for conda if you are not on conda env skip this step.

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

Comments

0

try:

pip --default-timeout=300 install tensorflow

This has worked for me as commented by Kenan since I'm using a non-conda environment.

Comments

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.