解决 pip 无法调用国外 pip 源问题

目的

解决 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'.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Terry_Tsang

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值