Visual Studio 2019 下Python安装第三方库

问题描述

在Visual Studio 2019 下Python安装第三方库,遇到问ssl证书问题。在安装matplotlib这个库时,出现以下问题。

Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Could not fetch URL https://pypi.tuna.tsinghua.edu.cn/simple/matplotlib/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.tuna.tsinghua.edu.cn', port=443): Max retries exceeded with url: /simple/matplotlib/ (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong versio
ERROR: Could not find a version that satisfies the requirement matplotlib (from versions: none)
ERROR: No matching distribution found for matplotlib

意思是在使用清华大学的镜像https://pypi.tuna.tsinghua.edu.cn/simple时不能连接上,也遇到ssl问题。

解决方法

换成阿里云的连接http://mirrors.aliyun.com/pypi/simple/,并且把连接设置为信任。

具体步骤

一 本地文件设置

在C盘—用户—账户名----pip文件夹(如果没有新建一个)在这里插入图片描述
在pip文件下,新建一个“pip.ini”文件
在这里插入图片描述

然后用记事本打开,把下面内容复制进去保存。

[global]
index-url =  http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
二,VS2019上的配置

找到 “解决方案资源管理器”,右击 “Python环境”,点击 “查看所有Python环境”
在这里插入图片描述
找到 “概述”,并点击 “PowerShell中打开”
在这里插入图片描述

输入

pip config list

得到如下界面:
在这里插入图片描述
下面我就可以之间使用,pip install pandas等命令安装第三方库了

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

remandancy.h

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

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

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

打赏作者

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

抵扣说明:

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

余额充值