vs中安装python环境以及遇到的问题和解决方法总结

前言:因为之前一直用的是pycharm
但是后面不知道为什么request包突然用不了了,找了原因,后面发觉应该是环境配置出了问题 好像跟自己的软件冲突了
于是弃pycharm到vs中集成来了

正文:

①安装python环境

直接搜索visual studio install中进行安装
在这里插入图片描述
然后点修改
在这里插入图片描述

进入后勾选python环境即可

②vs python 2.5及更早版本不允许调试

解决方法
在这里插入图片描述
点击添加/删除Python环境 选择Python3.6 该问题就可以解决

在这里插入图片描述

完美运行
在这里插入图片描述

标题③安装第三方包解决方法

一,点击查看所有的环境

二,在powershell中打开
在这里插入图片描述
三、国内镜像网站

国内镜像
http://pypi.douban.com/simple/ 豆瓣
http://mirrors.aliyun.com/pypi/simple/ 阿里
http://pypi.hustunique.com/simple/ 华中理工大学
http://pypi.sdutlinux.org/simple/ 山东理工大学
http://pypi.mirrors.ustc.edu.cn/simple/ 中国科学技术大学
https://pypi.tuna.tsinghua.edu.cn/simple 清华

四、使用pip命令安装

pip install --index https://pypi.mirrors.ustc.edu.cn/simple/ pandas

然后enter结束

④pip安装库的问题

常见问题
即需要指定源进行下载
在这里插入图片描述
捣鼓了很久终于弄明白了

比如下载 requests的方法

pip install -i 国内镜像地址 包名

例如: pip install -i https://mirrors.aliyun.com/pypi/simple/ numpy

pip install -i  https://mirrors.aliyun.com/pypi/simple/ requests

然后pip list
在这里插入图片描述
完美解决问题
pip典型语句链接

猜你喜欢

转载自blog.csdn.net/qq_33942040/article/details/107793553