2022年1月20日 星期四

[Python] 取代 pip search 的指令

由於XMLRPC 的濫用,因此 python.org 已經把使用 XMLRPC 的 pip search 永遠 banned 掉了。所以如果使用 pip search 會出現以下錯誤訊息。

```

ERROR: XMLRPC request failed [code: -32500]
RuntimeError: PyPI's XMLRPC API is currently disabled due to unmanageable load and will be deprecated in the near future. See https://status.python.org/ for more information.

```

還好有好心人寫了一個 script 的 wrapper 可以繼續簡單搜尋。步驟如下。

```

# 安裝
cd ~
git clone https://github.com/jeffmm/pypi-simple-search
cd pypi-simple-search
sudo make install

# 搜尋
pip-pss search foo

```

reference: https://stackoverflow.com/questions/66375972/getting-error-with-pip-search-and-pip-install