urllib.error.URLRERROR:<urlopen error[SSL:CERTIFICATE\u VERIFY\u FAILED]CERTIFICATE VERIFY失败:无法获取本地颁发者证书(\u SSL.c:1108)

2024-09-27 21:25:07 发布

您现在位置:Python中文网/ 问答频道 /正文

import yfinance as yf

msft=yf.Ticker(“msft”)

msft.info

我试图打印msft.info并得到“urllib.error.urleror:<;urlopen错误[SSL:CERTIFICATE\u VERIFY\u FAILED]证书验证失败:无法获取本地颁发者证书(\u SSL.c:1108)错误。我试图重新运行Install Certificates.command和Update Sheet.command,但显然没有成功。在我重新播放之后,我还做了以下按摩: 由于环境错误,无法安装程序包:[Errno 13]权限被拒绝:'/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/certifi-2021.5.30.dist-info

有什么建议吗?我该怎么修


Tags: importltinfosslas错误errorurllib
1条回答
网友
1楼 · 发布于 2024-09-27 21:25:07

快速谷歌搜索返回以下内容:http://blog.wafrat.com/fixing-certificate_verify_failed-when-using-yfinances-ticker-info/

如上面链接的网站所述,该问题是由于:

It turns out it's because I am running Python on Mac OS and I need to install some certificates (Mac OSX python ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)).

解决办法是:

So I opened Finder and navigated to Applications, Python 3.7, then ran Install Certificates.command. And it worked indeed!

相关问题 更多 >

    热门问题