直接安装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
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。