Vscode 无法加载 pip 下载好的模块

设置 vscode 配置文件

vscode 工作目录下的配置文件 /.vscode/settings.json 修改为:

{
   "python.pythonPath": "/usr/local/opt/python@3.9/bin/python3.9",
   "python.autoComplete.extraPaths": ["/usr/local/lib/python3.9/site-packages/"]
}
  • python.autoComplete.extraPaths 第三方模块的路径

查看模块安装的路径

some@some ~ $ pip3 install requests
Requirement already satisfied: requests in /usr/local/lib/python3.9/site-packages (2.25.1)
  • 第二行即为安装路径
posted @ 2021-01-28 19:52  室外  阅读(1123)  评论(0编辑  收藏  举报