直接安装Python的pip库yfinance,采用命令pip install yfinance后, 出现以下报错
Could not find a version that satisfies the requirement charset–normalizer<4,>=2 (from requests>=2.26->yfinance) (from versions: )
No matching distribution found for charset–normalizer<4,>=2 (from requests>=2.26->yfinance)
方法:
1. 采用国内镜像,输入命令
pip install yfinance –i http://pypi.douban.com/simple/ –trusted–host pypi.douban.com,即可解决。
2. 如果未成功,遇到了如下情况,显示报错
Failed cleaning build dir for cryptography
Failed to build cryptography
Could not build wheels for cryptography which use PEP 517 and cannot be installed directly
则可以更新一下pip
3. 更新pip库,采用命令
pip install —upgrade pip
升级成功,即显示Successfully installed pip-23.0.1
再次,输入命令pip install yfinance -i http://pypi.douban.com/simple/ –trusted-host pypi.douban.com
即成功安装了yfinance库,显示如下:
Successfully installed appdirs-1.4.4 beautifulsoup4-4.11.2 charset–normalizer-3.0.1 cryptography-39.0.1 frozendict-2.3.5 html5lib-1.1 lxml-4.9.2 multitasking-0.0.11 numpy-1.21.6 pandas-1.3.5 pytz-2022.7.1 requests-2.28.2 yfinance-0.2.12
原文地址:https://blog.csdn.net/weixin_46420501/article/details/129267320
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.7code.cn/show_23676.html
如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除!