pip install问题解决方案

问题描述

pip install时出现问题如下

(venvop) E:\worksp_py\langchain>pip install langchain
Looking in indexes: http://mirrors.aliyun.com/pypi
WARNING: The repository located at mirrors.aliyun.com 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 all
ow it anyway with '--trusted-host mirrors.aliyun.com'.
ERROR: Could not find a version that satisfies the requirement langchain (from versions: none)
ERROR: No matching distribution found for langchain
WARNING: The repository located at mirrors.aliyun.com 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 all
ow it anyway with '--trusted-host mirrors.aliyun.com'.

网上百度到的解决方法都是在每一次命令后加-i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
但是这样太麻烦了,且只是临时解决
后续经过寻找找到了这个方法来修改pip源文件

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple/

常用的镜像地址:

https://mirrors.aliyun.com/pypi/simple/ 阿里云
https://pypi.mirrors.ustc.edu.cn/simple/ 中国科技大学
https://pypi.douban.com/simple/ 豆瓣
https://pypi.tuna.tsinghua.edu.cn/simple/ 清华大学
http://pypi.mirrors.ustc.edu.cn/simple/ 中国科学技术大学
posted @ 2023-06-03 08:07  晓枫的春天  阅读(791)  评论(0编辑  收藏  举报