当前位置:   article > 正文

python学习日记(1)_warning: the repository located at pypi.tuna.tsing

warning: the repository located at pypi.tuna.tsinghua.edu.cn is not a truste

@TOC## python学习日记

更新pip且更换清华源来下载库

更换源时会遇到这种问题:

WARNING: The repository located at pypi.tuna.tsinghua.edu.cn is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with ‘–trusted-host pypi.tuna.tsinghua.edu.cn’.
ERROR: Could not find a version that satisfies the requirement SomePackage (from versions: none)
ERROR: No matching distribution found for SomePackage
WARNING: The repository located at pypi.tuna.tsinghua.edu.cn is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '–trusted-host

pypi.tuna.tsinghua.edu.cn’.

可以先在电脑文件搜索:%appdata%找到pip文件夹下的pip.ini文件
编辑:
[global]
timeout = 6000
index-url = http://pypi.tuna.tsinghua.edu.cn/simple/
trusted-host=pypi.tuna.tsinghua.edu.cn

回到cmd,输入:
python -m pip install -U pip

出现如下结果即成功。
在这里插入图片描述

安装库:
pip install [name]
在这里插入图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/黑客灵魂/article/detail/949771
推荐阅读
  

闽ICP备14008679号