简体   繁体   中英

How to solve the error in installing Tensorflow?

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM