最近下载安装包时出现了一些问题,与大家共同分享,欢迎讨论。
下载beautifulsoup4库
conda install beautifulsoup4
但回车运行后出现了以下错误:
Collecting package metadata (current_repodata.json): failed
CondaHTTPError: HTTP 429 TOO MANY REQUESTS for url <https://mirrors.ustc.edu.cn/anaconda/pkgs/free/win-64/current_repodata.json>
Elapsed: 00:46.246376
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
'https//mirrors.ustc.edu.cn/anaconda/pkgs/free/win-64'
运行成功 :
按照https://blog.csdn.net/Sakura_Logic/article/details/108312146博客中的解决方法,输入:
pip install beautifulsoup4 -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
得到了解决,运行成功结果如下:
下载selenium库
替换包名按照上述步骤进行下载出现了报错:
pip install selenium -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.comun.com
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
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 allow it anyway with '--trusted-host mirrors.aliyun.com'.
ERROR: Could not find a version that satisfies the requirement selenium (from versions: none)
ERROR: No matching distribution found for selenium
不太理解哪里出现了问题,于是开始寻找解决方法
尝试1:修改链接,更改镜像源
pip install selenium -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host mirrors.aliyun.comun.com
换了好几个镜像源之后还是没有用,出现了新的错误
尝试2:按照网上的教程进行修改尝试,还是出现了很多报错
conda config --set channel_priority flexible
conda install selenium
尝试3:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
conda install selenium
结果
运行成功 :
输出以下内容:
conda config --remove-key channels
conda install selenium
运行结果:
最后总算是成功了,希望能对正在安装的人有点帮助!