certbot-autoでNo matching distribution found for certifi==2019.3.9エラーが発生した時の対処法


問題

環境

  • centOS 7.6.1810 Core

certbotをcloneして実行したときにpip側でエラー発生.

# git clone https://github.com/certbot/certbot
# cd certbot
# ./certbot-auto certonly --standalone -t

Bootstrapping dependencies for RedHat-based OSes... (you can skip this with --no-bootstrap)
yum is /bin/yum
yum is hashed (/bin/yum)
Loaded plugins: fastestmirror
...(省略)
pip prints the following errors:
=====================================================
Collecting ConfigArgParse==0.14.0 (from -r /tmp/tmp.p57ONgbkAA/letsencrypt-auto-requirements.txt (line 7))
  Downloading http://jp.mirrors.cloud.aliyuncs.com/pypi/packages/55/ea/f0ade52790bcd687127a302b26c1663bf2e0f23210d5281dbfcd1dfcda28/ConfigArgParse-0.14.0.tar.gz
Collecting asn1crypto==0.24.0 (from -r /tmp/tmp.p57ONgbkAA/letsencrypt-auto-requirements.txt (line 9))
  Downloading http://jp.mirrors.cloud.aliyuncs.com/pypi/packages/ea/cd/35485615f45f30a510576f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl (101kB)
Collecting certifi==2019.3.9 (from -r /tmp/tmp.p57ONgbkAA/letsencrypt-auto-requirements.txt (line 12))
  Could not find a version that satisfies the requirement certifi==2019.3.9 (from -r /tmp/tmp.p57ONgbkAA/letsencrypt-auto-requirements.txt (line 12)) (from versions: 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.6, 0.0.7, 0.0.8, 1.0.0, 1.0.1, 14.5.14, 2015.4.28, 2015.9.6, 2015.9.6.1, 2015.9.6.2, 2015.11.20, 2015.11.20.1, 2016.2.28, 2016.8.2, 2016.8.8, 2016.8.31, 2016.9.26, 2017.1.23, 2017.4.17, 2017.7.27, 2017.7.27.1, 2017.11.5, 2018.1.18, 2018.4.16, 2018.8.13, 2018.8.24, 2018.10.15, 2018.11.29)
↓↓↓ 問題発生
No matching distribution found for certifi==2019.3.9 (from -r /tmp/tmp.p57ONgbkAA/letsencrypt-auto-requirements.txt (line 12))
↑↑↑ 問題発生
=====================================================
...(省略)

certifi==2019.3.9が見つからないらしい.

解決方法

# rm -f /root/.pip/pip.conf

/root/.pip/pip.confを認識させないようにすればよい.