解决vscode上python代码无法解析导入
1.已经生成了虚拟环境了,如以下结构
⏺ your-project/
├── .gitignore
├── api/
│ └── index.py
├── requirements.txt
└── .venv/
└── (虚拟环境文件)
2.vscode上显示如下报错
For the code present, we get this error:
```
无法解析导入“flask”
```
How can I resolve this? If you propose a fix, please make it concise.
解决:
按Cmd+Shift+P
,输入Python: Select Interpreter
,选择项目里的.venv
里的Python
。
License:
CC BY 4.0