环境:
mac os
背景:
电脑之前安装的是python3.9 , 现在升级到python3.10。 从python官网下载macos版本的python3.10 pkg。 双击安装。
程序使用aiohttp访问ebay 。
出错:
aiohttp.client_exceptions.clientconnectorcertificateerror: cannot connect to host www.ebay.com:443 ssl:true [sslcertverificationerror: (1, '[ssl: certificate_verify_failed] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')]
但是旧版本python执行程序时不会出现以上问题。猜是新python的环境没配置好。
解决方法
进入python 3.10 的application安装路径。
cd /applications/python\ 3.10/
执行证书安装命令:
./install\ certificates.command
安装完成
重新执行程序。 无错误。
发表评论