会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 134118个问题
JAVA 全系列/第一阶段:AI驱动的JAVA编程/飞机大战小项目训练 8551楼
JAVA 全系列/第四阶段:数据库与AI协同技术实战/Oracle 数据库的使用 8552楼
JAVA 全系列/预科阶段:职业规划/学习方法/程序员的基本素养和职业规划 8553楼
JAVA 全系列/第五阶段:网页编程和设计/JavaScript语言 8555楼

1689072302831.jpg

Python全系列/第十六阶段:Python 爬虫开发/scrapy框架使用 8559楼
Python全系列/第二阶段:Python 深入与提高/文件处理 8560楼
Python全系列/第一阶段:AI驱动的Python编程/序列 8561楼

在本视频中发送Get请求带参数的案例中,如果请求的地址是https协议则会报错(如果是http协议就没错),错误信息如下图(注:HTTPClient版本为4.3.5  JDK1.8)  通过网络上也找了一些解决办法,但是试了下没啥用(附带几个链接:https://blog.csdn.net/xuzhuang2008/article/details/43306111   )


代码截图:

图片.png

错误信息:

Exception in thread "main" javax.net.ssl.SSLKeyException: RSA premaster secret error
    at sun.security.ssl.RSAClientKeyExchange.<init>(Unknown Source)
    at sun.security.ssl.ClientHandshaker.serverHelloDone(Unknown Source)
    at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
    at sun.security.ssl.Handshaker.processLoop(Unknown Source)
    at sun.security.ssl.Handshaker.process_record(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:275)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:254)
    at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:123)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:318)
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:219)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:86)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:106)
    at com.bjsxt.test.HttpClientTest.doGetParam(HttpClientTest.java:60)
    at com.bjsxt.test.HttpClientTest.main(HttpClientTest.java:18)
Caused by: java.security.NoSuchAlgorithmException: SunTls12RsaPremasterSecret KeyGenerator not available
    at javax.crypto.KeyGenerator.<init>(KeyGenerator.java:169)
    at javax.crypto.KeyGenerator.getInstance(KeyGenerator.java:223)
    at sun.security.ssl.JsseJce.getKeyGenerator(Unknown Source)
    ... 23 more


JAVA 全系列/(旧的隐藏)第七阶段:JAVA 高级技术/HttpClient 8562楼
Python全系列/第七阶段:网页编程基础/JavaScript 8563楼

#pip install python-pptx
from pptx import Presentation
def creat_ppt():
    #创建ppt对象
    ppt = Presentation()
    #添加幻灯片
    ppt.slides.add_slide(ppt.slide_layouts[0])
    #保存
    ppt.save('./creat_ppts/01_ppt.pptx')

if __name__ == '__main__':
    creat_ppt()

Traceback (most recent call last):

  File "D:\Users\W9020478\AppData\Local\Programs\Python\Python311\Lib\site-packages\pptx\compat\__init__.py", line 10, in <module>

    Container = collections.abc.Container

                ^^^^^^^^^^^^^^^

AttributeError: module 'collections' has no attribute 'abc'     


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "f:\vscode\auto_ppt\01creat_ppt.py", line 2, in <module> 

    from pptx import Presentation

  File "D:\Users\W9020478\AppData\Local\Programs\Python\Python311\Lib\site-packages\pptx\__init__.py", line 14, in <module>     

    from pptx.api import Presentation  # noqa

    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\Users\W9020478\AppData\Local\Programs\Python\Python311\Lib\site-packages\pptx\api.py", line 15, in <module>

    from .package import Package

  File "D:\Users\W9020478\AppData\Local\Programs\Python\Python311\Lib\site-packages\pptx\package.py", line 6, in <module>

    from pptx.opc.package import OpcPackage

  File "D:\Users\W9020478\AppData\Local\Programs\Python\Python311\Lib\site-packages\pptx\opc\package.py", line 11, in <module>

    from pptx.compat import is_string, Mapping

  File "D:\Users\W9020478\AppData\Local\Programs\Python\Python311\Lib\site-packages\pptx\compat\__init__.py", line 14, in <module>

    Container = collections.Container

                ^^^^^^^^^^^^^^^^^^^^^

AttributeError: module 'collections' has no attribute 'Container'

这是什么错误

Python全系列/ 第十五阶段:自动化操作办公软件、邮件、定时任务等/办公自动化 8564楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园
网站维护:百战汇智(北京)科技有限公司
京公网安备 11011402011233号    京ICP备18060230号-3    营业执照    经营许可证:京B2-20212637