Skip to main content

两个最近碰到棘手的技术问题

· One min read

问题一: Python 环境无法退出

碰到个很棘手的问题,vsc 里面,我创建了 python venv, 启动后,我把 venv 删掉了,导致无法正常退出 之前删除的 venv。

解决方案:

试了直接关掉所有 Terminal,没用,启动后还会有,可能环境被缓存。

设置 VSC,重置 Python 解释器

  • 按  Ctrl+Shift+P (Windows/Linux) 或  Cmd+Shift+P (Mac) 打开命令面板
  • 输入并选择 "Python: Select Interpreter"
  • 选择一个可用的 Python 解释器(非已删除的 venv)

问题-Python 环境无法退出.pdf

问题二: Git Submodule 无法正常删除

3 步解决

  1. git submodule deinit -f -- <submodule path>

这里的-- 不确定要不要,不用也可以。

  1. rm -rf .git/modules/<submodule name>

删掉 git 元数据中的 submodule

  1. git rm -f <submodule path> or git rm --cached <submodule path>

删除本地代码(全删 或者 软删)。