目的
解决 pip 无法调用国外 pip 源问题
安装 guestfs python 库失败遇到问题
[root@ns-compute-210069 bin]# ./pip3.7 install /tmp/guestfs-1.40.1.tar.gz
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Processing /tmp/guestfs-1.40.1.tar.gz
Installing collected packages: guestfs
Found existing installation: guestfs 1.40.1
Uninstalling guestfs-1.40.1:
Successfully uninstalled guestfs-1.40.1
Running setup.py install for guestfs ... done
Successfully installed guestfs-1.40.1
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
分析,在安装过程中,需要调用国外 pip 源
但由于 ssl 墙问题, 需要换成国内(阿里源)
[root@ns-compute-210069 bin]# ./pip3.7 config set global.index-url http://mirrors.aliyun.com/pypi/simple/
Writing to /root/.config/pip/pip.conf
再次进行 python 模块安装
警告信息忽略, 安装成功
root@ns-compute-210069 bin]# ./pip3.7 install /tmp/guestfs-1.40.1.tar.gz
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Processing /tmp/guestfs-1.40.1.tar.gz
Installing collected packages: guestfs
Found existing installation: guestfs 1.40.1
Uninstalling guestfs-1.40.1:
Successfully uninstalled guestfs-1.40.1
Running setup.py install for guestfs ... done
Successfully installed guestfs-1.40.1
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'.