记录踩过的坑-macOS下使用VS Code

目录

切换主题

安装插件

方法1

方法2

搭建Python开发环境

装Python插件

配置解释器

打开项目

打开终端

[INFO: pip is looking at multiple versions xxxx,过了很久后报错](#INFO: pip is looking at multiple versions xxxx,过了很久后报错)

方法1

方法2

​​​​​​​


切换主题

安装插件

方法1

方法2

搭建Python开发环境

装Python插件

配置解释器

假设解释器已经通过Anaconda建好,只需要在VS Code中关联。

打开项目

打开终端

INFO: pip is looking at multiple versions xxxx,过了很久后报错

新版pip有个冲突检测机制,有时候包依赖过于复杂,导致陷入无限循环而报错。

方法1

可以考虑用pip的旧解析器:

复制代码
pip install -r xxx --use-deprecated=legacy-resolver

装完之后会提示:

复制代码
ERROR: pip's legacy dependency resolver does not consider dependency conflicts when selecting packages. This behaviour is the source of the following dependency conflicts.

xxx requires xxx

......

意思就是检测到一些依赖冲突,这个时候按提示重装对应的包

方法2

更加合理的方案应该是在requirements.txt中固定包版本

如果不知道每个包的具体版本,可以一个个包先装一次,然后生成requirements.txt

相关推荐
用户83580861879115 小时前
基于 Self-RAG 与列表级重排序的进阶 RAG 系统设计与实现
python
Warson_L1 天前
Python `Annotated` 与 LangGraph Reducer 学习笔记
python
韩师傅1 天前
海天线算法的前世今生
python·计算机视觉
韩师傅1 天前
当你的甲方设备过烂,要如何快速出效果?
python·计算机视觉
Warson_L1 天前
LangGraph的MessageState and HumanMessage
python
韩师傅1 天前
当你的甲方吐槽天空不够蓝,你应该如何应对
python·计算机视觉
Warson_L1 天前
python的类&继承
python
Warson_L1 天前
类型标注/type annotation
python
ThreeS1 天前
手搓MiniVLA全实战教程-一步一步用pytorch解释原理与思路
人工智能·python
金銀銅鐵2 天前
[Python] 模 n 乘法的逆元计算器
python·数学·游戏