【树莓派】报错 pip is configured with locations that require TLS/SSL(2021年12月31日已解决)

报错信息

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.python.org/simple/opencv-python/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping

系统

树莓派 3b
安装完系统后树莓派自带的是 python3.9
但是由于开发需要安装 python3.6

下载了 python3.6.8 源代码后编译安装
运行

curl https://bootstrap.pypa.io/get-pip.py | python

发生了前面提到的报错,是 openssl 的问题,使用命令查看了一下,系统中是有 openssl 的,而且也是最新版本,所以问题应该还是 python3.6 的安装引起的。
所以网上提到的重装 openssl 是无效的

解决方案

  1. 第一步安装需要的依赖文件
sudo apt-get install build-essential checkinstall 
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
  1. 第二步重新到 python3.6.8 的源代码文件夹内,编译安装 python3.6.8

然后问题就解决了!

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值