今天学习SSD需要用到keras库,在安装时遇到了一些问题如下:

(tensorflow) C:\Users\Acer>pip install keras==1.2.2
Collecting keras==1.2.2Downloading Keras-1.2.2.tar.gz (175 kB)---------------------------- ----------- 122.9/175.5 KB 84.8 kB/s eta 0:00:01
ERROR: Exception:
Traceback (most recent call last):File "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_vendor\urllib3\response.py", line 438, in _error_catcheryieldFile "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_vendor\urllib3\response.py", line 519, in readdata = self._fp.read(amt) if not fp_closed else b""File "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 90, in readdata = self.__fp.read(amt)File "C:\Users\Acer\.conda\envs\tensorflow\lib\http\client.py", line 465, in readn = self.readinto(b)File "C:\Users\Acer\.conda\envs\tensorflow\lib\http\client.py", line 509, in readinton = self.fp.readinto(b)File "C:\Users\Acer\.conda\envs\tensorflow\lib\socket.py", line 589, in readintoreturn self._sock.recv_into(b)File "C:\Users\Acer\.conda\envs\tensorflow\lib\ssl.py", line 1071, in recv_intoreturn self.read(nbytes, buffer)File "C:\Users\Acer\.conda\envs\tensorflow\lib\ssl.py", line 929, in readreturn self._sslobj.read(len, buffer)
socket.timeout: The read operation timed outDuring handling of the above exception, another exception occurred:Traceback (most recent call last):File "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_internal\cli\base_command.py", line 167, in exc_logging_wrapperstatus = run_func(*args)File "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_internal\cli\req_command.py", line 205, in wrapperreturn func(self, options, args)File "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_internal\commands\install.py", line 340, in runreqs, check_supported_wheels=not options.target_dirFile "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_internal\resolution\resolvelib\resolver.py", line 95, in resolvecollected.requirements, max_rounds=try_to_avoid_resolution_too_deepFile "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 481, in resolvestate = resolution.resolve(requirements, max_rounds=max_rounds)File "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 348, in resolveself._add_to_criteria(self.state.criteria, r, parent=None)File "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 172, in _add_to_criteriaif not criterion.candidates:File "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_vendor\resolvelib\structs.py", line 151, in __bool__return bool(self._sequence)File "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 155, in __bool__return any(self)File "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 143, in <genexpr>return (c for c in iterator if id(c) not in self._incompatible_ids)File "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 47, in _iter_builtcandidate = func()File "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_internal\resolution\resolvelib\factory.py", line 220, in _make_candidate_from_linkversion=version,File "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 294, in __init__version=version,File "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 158, in __init__self.dist = self._prepare()File "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 227, in _preparedist = self._prepare_distribution()File "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 299, in _prepare_distributionreturn preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)File "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_internal\operations\prepare.py", line 487, in prepare_linked_requirementreturn self._prepare_linked_requirement(req, parallel_builds)File "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_internal\operations\prepare.py", line 538, in _prepare_linked_requirementhashes,File "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_internal\operations\prepare.py", line 218, in unpack_urlhashes=hashes,File "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_internal\operations\prepare.py", line 94, in get_http_urlfrom_path, content_type = download(link, temp_dir.path)File "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_internal\network\download.py", line 146, in __call__for chunk in chunks:File "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_internal\cli\progress_bars.py", line 304, in _rich_progress_barfor chunk in iterable:File "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_internal\network\utils.py", line 87, in response_chunksdecode_content=False,File "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_vendor\urllib3\response.py", line 576, in streamdata = self.read(amt=amt, decode_content=decode_content)File "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_vendor\urllib3\response.py", line 541, in readraise IncompleteRead(self._fp_bytes_read, self.length_remaining)File "C:\Users\Acer\.conda\envs\tensorflow\lib\contextlib.py", line 130, in __exit__self.gen.throw(type, value, traceback)File "C:\Users\Acer\.conda\envs\tensorflow\lib\site-packages\pip\_vendor\urllib3\response.py", line 443, in _error_catcherraise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

前面一大堆不知道是错在哪,看到最后关键的一句

pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

Read timed out.超时了

在网上找了一下资料,终于找到了解决办法。

解决方法:

在项目所在的环境中修改,设置超时时间:

pip --default-timeout=100 install -U Pillow

(tensorflow) C:\Users\Acer>pip --default-timeout=100 install -U Pillow
Requirement already satisfied: Pillow in c:\users\acer\.conda\envs\tensorflow\lib\site-packages (9.1.0)
Collecting PillowDownloading Pillow-9.1.1-cp37-cp37m-win_amd64.whl (3.3 MB)---------------------------------------- 3.3/3.3 MB 113.0 kB/s eta 0:00:00
Installing collected packages: PillowAttempting uninstall: PillowFound existing installation: Pillow 9.1.0Uninstalling Pillow-9.1.0:Successfully uninstalled Pillow-9.1.0
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
matplotlib 3.5.2 requires numpy>=1.17, but you have numpy 1.16.5 which is incompatible.
Successfully installed Pillow-9.1.1

设置好之后,再次安装keras库,就可以了

(tensorflow) C:\Users\Acer>pip install keras==1.2.2
Collecting keras==1.2.2Downloading Keras-1.2.2.tar.gz (175 kB)---------------------------------------- 175.5/175.5 KB 278.6 kB/s eta 0:00:00Preparing metadata (setup.py) ... done
Collecting theanoDownloading Theano-1.0.5.tar.gz (2.8 MB)---------------------------------------- 2.8/2.8 MB 46.3 kB/s eta 0:00:00Preparing metadata (setup.py) ... done
Collecting pyyamlUsing cached PyYAML-6.0-cp37-cp37m-win_amd64.whl (153 kB)
Requirement already satisfied: six in c:\users\acer\.conda\envs\tensorflow\lib\site-packages (from keras==1.2.2) (1.16.0)
Requirement already satisfied: numpy>=1.9.1 in c:\users\acer\.conda\envs\tensorflow\lib\site-packages (from theano->keras==1.2.2) (1.16.5)
Requirement already satisfied: scipy>=0.14 in c:\users\acer\.conda\envs\tensorflow\lib\site-packages (from theano->keras==1.2.2) (1.7.3)
Building wheels for collected packages: keras, theanoBuilding wheel for keras (setup.py) ... doneCreated wheel for keras: filename=Keras-1.2.2-py3-none-any.whl size=209603 sha256=a09df34f79d7be79f490aed3f9c34a7568c7acf39060fca37410fd66d8ef31b0Stored in directory: c:\users\acer\appdata\local\pip\cache\wheels\d1\32\23\2a1db3765ec19c91503843380a4f92b6530598949c661c5fa2Building wheel for theano (setup.py) ... doneCreated wheel for theano: filename=Theano-1.0.5-py3-none-any.whl size=2668124 sha256=baff978414aacc3ccdcf391b393f22037d6cffa7f59b892c21b2fadcb0a632ceStored in directory: c:\users\acer\appdata\local\pip\cache\wheels\26\68\6f\745330367ce7822fe0cd863712858151f5723a0a5e322cc144
Successfully built keras theano
Installing collected packages: pyyaml, theano, keras
Successfully installed keras-1.2.2 pyyaml-6.0 theano-1.0.5

最后显示,成功安装,撒花。。。。

这个也可以应用于python安装其他的第三方库超时的情况。如果这样操作之后还行显示超时,那么可能是网络问题,换一个比较好的网络环境再多试几次。

参考资料:python 安装第三方库,超时报错--Read timed out.(亲测有效)_小志的博客的博客-CSDN博客

在Anaconda建立的虚拟环境中安装keras时报错,显示超时报错--Read timed out.相关推荐

  1. 安装32位mysql报错_在CentOS中安装32位或64位MySql报错error: Failed dependencies解决办法...

    在CentOS中安装MySql报错error: Failed dependencies解决办法 安装64位MySql报错内容如下: error: Failed dependencies: libaio ...

  2. spyder安装python包(附超时报错解决办法)

    找到 anaconda 的命令窗口 比如我要安装的包名是 docx 首先检查pip是否安装 pip 出现如下界面即是已经有 pip 了 然后我们借助pip来安装扩展包 直接输入如下命令 pip ins ...

  3. Python中安装bs4后,pycharm依然报错ModuleNotFoundError: No module named 'bs4'

    学习网络抓取时,第一步出现问题. 执行示例代码 from urllib.request import urlopen from bs4 import BeautifulSoup html = urlo ...

  4. linux中安装redis 使用make install 命令报错

    错误 server.c:5007:38: error: 'struct redisServer' has no member named 'aof_filename'if (loadAppendOnl ...

  5. (win10)anaconda虚拟环境中安装特定版本cuda+tensorflow+pytorch+pycharm

    1.安装anaconda 在官网安装最新版的anaconda,需要使用其他版本的python可创建虚拟环境.安装时选择all users以及添加环境变量. 2.安装cuda以及cudnn. 你可以选择 ...

  6. python虚拟环境安装的包在哪_如何使用virtualenv引导脚本在虚拟环境中安装python包?...

    我想创建一个引导脚本来设置本地环境并在其中安装所有要求.我一直在尝试使用virtualenv.create_bootstrap_script,如docs所述. import virtualenv s ...

  7. python虚拟环境中安装diango_创建python虚拟环境,安装django,创建一个django项目,在项目中创建一个应用(ubuntu16.04)...

    一.创建python虚拟环境 首先,为什么要创建python的虚拟环境? 因为,在实际的项目开发中,每个项目使用的框架库并不一样,或使用框架的版本不一样,这样需要 我们根据需求不断的更新或卸载相应的库 ...

  8. conda虚拟环境中 安装 jupyter notebook

    @创建于:2022.01.27 @修改于:2022.01.27 文章目录 需要在conda的某个特定虚拟环境中安装Jupyter Notebook. # 进入虚拟环境(windows系统) conda ...

  9. 在conda虚拟环境中安装ipython

      大家好,我是爱编程的喵喵.双985硕士毕业,现担任全栈工程师一职,热衷于将数据思维应用到工作与生活中.从事机器学习以及相关的前后端开发工作.曾在阿里云.科大讯飞.CCF等比赛获得多次Top名次.现 ...

最新文章

  1. 微软开源 Windows 软件包管理器 winget,一行命令安装软件
  2. Hibernate关联查询
  3. C/C++学习之路_七: 内存管理
  4. window实用快捷键
  5. intellij自动生成构造函数
  6. Hibernate中1+N问题以及解决方法
  7. BeanUtils工具的使用(转载)
  8. influx 操作_InfluxDB学习之InfluxDB的基本操作-阿里云开发者社区
  9. 一句话满速下载清华源3.4.1.15版本的opencv和contrib库
  10. js中substr,substring,indexOf,lastIndexOf,split 的用法
  11. 一篇博客:分类模型的 Loss 为什么使用 cross entropy 而不是 classification error 或 squared error...
  12. Atitit 找人软福利建设 技术团队建设大概流程
  13. pdf 修改title
  14. python规模大小的指标是_Python 做证券指数三种策略分析 - 最高收益,最大规模,最小风险...
  15. Java并发之-队列同步器AQS
  16. html计时加速,HTML-加速、再加速(下)_html
  17. 分布式计算 lab2 Java RMI
  18. screenX、clientX、pageX三者间的区别
  19. java 微信请求超时_java – SQL服务器“超出锁定请求超时时间”..再次
  20. hibernate中lazy的使用

热门文章

  1. JavaWeb——day32 HTTP协议 ,Request,Respond,servlet及生命周期,ServletConfig
  2. USB入门开发的八个问题USB枚举『转』
  3. 「SpringBoot学习一」开发入门--快速创建springboot程序
  4. eclipse之版本代号
  5. PHP与正则表达式 | 黄乔国PHP
  6. 信号与系统第二次试验:连续时间 LTI 系统的时域分析
  7. 使用电信 TR069 内网架设 WireGuard 隧道异地组网
  8. linux nginx 缓存服务器,linux nginx 图片缓存服务器
  9. 开设 AI本科专业 的国内高校一览
  10. 高等数学---数列的极限