gpt4 book ai didi

python - 使用 anaconda3 python 3.5 安装 Tensorflow 得到 'Read timed out error"

转载 作者:行者123 更新时间:2023-12-01 22:11:31 25 4
gpt4 key购买 nike

我正在尝试安装 tensorflow-gpu使用 python3.6 和 anaconda 3我正在按照以下链接中的安装步骤 https://www.tensorflow.org/install/install_windows

1- 我通过调用以下命令创建了一个名为 tensorflow 的 conda 环境:

C:> conda create -n tensorflow python=3.6

2- 然后通过发出以下命令激活 conda 环境:

C:>激活tensorflow( tensorflow )C:>

但要进行最后一步,以便在我的 conda 环境中安装 TensorFlow。使用该命令 pip install --ignore-installed --upgrade tensorflow-gpu我得到了那个错误

(C:\Users\Chaymae\Anaconda3) C:\WINDOWS\system32>activate tensorflow

(tensorflow) C:\WINDOWS\system32>pip install --ignore-installed --upgrade tensorflow-gpu
Collecting tensorflow-gpu
Downloading tensorflow_gpu-1.4.0-cp36-cp36m-win_amd64.whl (67.6MB)
25% |████████ | 16.9MB 5.3kB/s eta 2:38:22Exception:
Traceback (most recent call last):
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\_vendor\urllib3\response.py", line 302, in _error_catcher
yield
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\_vendor\urllib3\response.py", line 384, in read
data = self._fp.read(amt)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 60, in read
data = self.__fp.read(amt)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\http\client.py", line 449, in read
n = self.readinto(b)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\http\client.py", line 493, in readinto
n = self.fp.readinto(b)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\socket.py", line 586, in readinto
return self._sock.recv_into(b)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\ssl.py", line 1009, in recv_into
return self.read(nbytes, buffer)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\ssl.py", line 871, in read
return self._sslobj.read(len, buffer)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\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\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\commands\install.py", line 335, in run
wb.build(autobuilding=True)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\req\req_set.py", line 620, in _prepare_file
session=self.session, hashes=hashes)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\download.py", line 821, in unpack_url
hashes=hashes
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\download.py", line 659, in unpack_http_url
hashes)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\download.py", line 882, in _download_http_url
_download_url(resp, link, content_file, hashes)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\download.py", line 603, in _download_url
hashes.check_against_chunks(downloaded_chunks)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\utils\hashes.py", line 46, in check_against_chunks
for chunk in chunks:
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\download.py", line 571, in written_chunks
for chunk in chunks:
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\utils\ui.py", line 139, in iter
for x in it:
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\download.py", line 560, in resp_read
decode_content=False):
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\_vendor\urllib3\response.py", line 436, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\_vendor\urllib3\response.py", line 401, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\contextlib.py", line 99, in __exit__
self.gen.throw(type, value, traceback)
File "C:\Users\Chaymae\Anaconda3\envs\tensorflow\lib\site-packages\pip\_vendor\urllib3\response.py", line 307, in _error_catcher
raise ReadTimeoutError(self._pool, None, 'Read timed out.')
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out.

然后我尝试安装 cpu 版本,但我遇到了同样的错误。如果有人能提供帮助,我将不胜感激,我真的很想开始学习 tensorflow。

最佳答案

有同样的超时问题。

pip --default-timeout=300 install tensorflow 但仍然有同样的问题。

在网上搜索更多信息,我设法使用 pip 安装了 TF。

这就是我为解决这个问题所做的:

先运行这一行

  1. conda config --set ssl_verify no

按此操作(您可以更改超时或尝试不设置超时)

  1. pip --default-timeout=300 安装 tensorflow

关于python - 使用 anaconda3 python 3.5 安装 Tensorflow 得到 'Read timed out error",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47610308/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com