目录

可能原因一:requests包安装不完全

可能原因二:服务器环境问题


可能原因一:requests包安装不完全

这个问题产生的原因:在安装 requests 库的时候,没有正确安装 security 包。

下面是解决方案(针对 Ubuntu):

1. 安装支持的 dev 包:

sudo apt-get install libffi-dev libssl-dev python-dev

若不安装上面的包,在安装 requests 的相关支持包的时候,可能会出现下面的错误:

distutils.errors.DistutilsError: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Failed cleaning build dir for cryptography

2. 安装 requests 及其安全支持包

pip install 'requests[security]'

requests[security] 是一个扩展,它会安装下面三个附加的包用来支持安全连接:

  • pyOpenSSL
  • ndg-httpsclient
  • pyasn1

可能原因二:服务器环境问题

长时间运行的服务器,可以出现某些问题,解决方法是重启服务器

python3 requests 错误EOF occurred in violation of protocol 解决方法相关推荐

  1. youtube_dl urlopen error EOF occurred in violation of protocol (_ssl.c:nnn) 错误的解决方法

    youtube_dl urlopen error EOF occurred in violation of protocol (_ssl.c:nnn) 错误的解决方法 参考文章: (1)youtube ...

  2. Python _ssl.c:507: EOF occurred in violation of protocol

    之前所有写的代码中,有一些使用了Urllib2去请求了公司内部网络的一些REST API. 最近不知道为什么一直频繁报出 _ssl.c:507: EOF occurred in violation o ...

  3. urllib.error.URLError: <urlopen error EOF occurred in violation of protocol (_ssl.c:1045)>

    在跑open_clip测试代码的时候,遇到一个问题,执行这一句的时候: model, _, preprocess = open_clip.create_model_and_transforms('Vi ...

  4. sqlserver 遇到以零作除数错误的处理 不报错的解决方法

    sqlserver 遇到以零作除数错误的处理 不报错的解决方法 参考文章: (1)sqlserver 遇到以零作除数错误的处理 不报错的解决方法 (2)https://www.cnblogs.com/ ...

  5. Win2008上.NET4.0部署出错HTTP 错误 500.21 - Internal Server Error的解决方法

    Win2008上.NET4.0部署出错HTTP 错误 500.21 - Internal Server Error的解决方法 参考文章: (1)Win2008上.NET4.0部署出错HTTP 错误 5 ...

  6. FTP错误 [ftp: connect: No route to host] 解决方法

    FTP错误 [ftp: connect: No route to host] 解决方法 参考文章: (1)FTP错误 [ftp: connect: No route to host] 解决方法 (2) ...

  7. win7下计划任务schtasks使用详解及错误:无法加载列资源的解决方法1

    win7下计划任务schtasks使用详解及"错误:无法加载列资源"的解决方法1 2011-12-10 20:33 schtasks 命令简述: 安排命令和程序,使其定期运行或在指 ...

  8. sqlserver 遇到以零作除数错误的处理 不报错的解决方法

    原文:sqlserver 遇到以零作除数错误的处理 不报错的解决方法 使用sqlserver 的选项来禁止出现以零除的错误中断,让而让其为null set ansi_warnings off SET  ...

  9. python3.6.1+selenium3.0环境安装问题及解决方法

    python3.6.1+selenium3.0环境安装问题及解决方法 参考文章: (1)python3.6.1+selenium3.0环境安装问题及解决方法 (2)https://www.cnblog ...

最新文章

  1. python语言的理解-终于明白python语言的特点是什么
  2. pytorch nn.Linear(对输入数据做线性变换:y=Ax+b)(全连接层?)
  3. 2020年蓝桥杯模拟赛2020.3.25直播笔记
  4. 2分钟 Docker 部署 SprinBoot 集成 Flowable 工作流引擎
  5. matlab 高斯消去法程序,高斯消去法解线性方程的Matlab程序
  6. php pg_fetch_row,pg_fetch_row
  7. 软件测试报告的项目背景,软件测试报告范本
  8. 普源DG5000系列函数/任意波形发生器功能解析
  9. 光波叠加matlab,光波的叠加教程.ppt
  10. 数学建模学习(75):全局敏感性分析Morris 方法
  11. matlab定义struck,Peter Struck
  12. Matlab/simulink通信系统仿真入门操作
  13. 搭建项目框架时需要考虑的几个问题
  14. 如何配置一台支持6块RTX3090静音级深度学习工作站
  15. SpringSecurity启动器
  16. 回溯法--最大团(部队护卫队问题)
  17. linux aarch64启动不了,引导AArch64 Linux
  18. 触发器与存储过程的区别
  19. 政考网:公考报班到底靠不靠谱
  20. 汽车行驶工况构建 2019D题

热门文章

  1. adb和adb shell
  2. 如何使自己的程序只运行一次
  3. Ruby错误:iconv will be deprecated in the future, use String#encode instead.
  4. 代练怎么检测出来的_王者荣耀:代练熬夜打上王者,天美发来58个字,不敢收一分钱...
  5. python文件的用法_Python文件读写常见用法总结
  6. Tungsten Fabric SDN — 操作实践 — Virtual Networks L2/L3 互联
  7. 工业互联网 — 5G 与 IIoT
  8. STM32堆和栈(Heap Stack)及SRAM存储使用
  9. 作业03:格式化输出
  10. PIE SDK Geometry的坐标转换