嗨,大约两天后我收到此错误:
错误:XMLRPC 请求失败 [代码:-32500] 运行时错误:由于无法管理的负载,PyPI 的 XMLRPC API 目前被禁用,将在不久的将来弃用。有关更多信息,请参阅https://status.python.org/。
我从一些人问,搜查了很多,但我din't kbow是什么问题以及如何解决它我tryed apt update,并python3 pip install --upgrade pip通过PIP本身我在使用Android的PIP Termux是工作了一段日前建议...
小智 41
可悲的pip search是现在被python.org永久禁止。
他们表示,他们在 100 天内(自 2020 年 11 月 14 日起)经历了“每小时数十万次搜索调用”,并且在发生这种情况之前,已经确定不推荐使用用于搜索调用的 XMLRPC API .
所以也许我们需要直接在pypi.org上搜索包,或者转向像pypi-simple-search或pipsearch 这样的包。
小智 5
如果您点击链接,在上次更新中他们指出 XMLRPC API 已被禁用(由于流量过大)。该方法pip search目前已被禁用。上次更新是一个月前发布的,我看不到任何变化。
对于基于包名称模式的搜索,我在下面分享这个脚本,希望您发现它有用。
#!/bin/bash
# pypi-search.sh
# This script fetch data from https://pypi.org/simple/
# process the output for simple package name output with perl
# and then apply a regex pattern to the result
pypiurl=https://pypi.org/simple/
currentdate=$(date +%y%m%d)
cachedir=~/.cache/simple-pypi
[[ -d $cachedir ]] || mkdir -p $cachedir
cachefile=$(ls -1 $cachedir/*_simple-pypi.html 2>/dev/null | sort | head -n1)
[[ $cachefile = "" ]] && cachefile=$cachedir/"${currentdate}_simple-pypi.html"
searchpattern="$1"
cmd="$2"
if [[ -f $cachefile ]] ; then
dbdate=$(echo $cachefile | grep -Po "[0-9]{6,6}")
# if db is older than 3 days or second parameter is 'update'
( (( ($currentdate - $dbdate) > 3 )) || [[ "x$cmd" = 'xupdate' ]] ) && {
echo "last update was on : $dbdate"
cachefile=$cachedir/"${currentdate}_simple-pypi.html"
wget -q --show-progress -O - $pypiurl > $cachefile
}
else
wget -q --show-progress -O - $pypiurl > $cachefile
fi
[[ x$searchpattern = "x" ]] && read -p "Enter pypi name pattern : " searchpattern
perl -pe 's/.*([\/"]{1,1}\>){1,1}([^>]+(.*)[^<])+\<\/a\>/\2/g' $cachefile | grep -P "$searchpattern"
Run Code Online (Sandbox Code Playgroud)
用法:pypi-search.sh ^pip$
| 归档时间: |
|
| 查看次数: |
16192 次 |
| 最近记录: |