设置 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)
- 第二行即为安装路径