[英]reportMissingImports Python error but import works fine
When I install package with python and import it, I often get a missing imports message such as:当我使用 python 安装 package 并导入它时,我经常收到缺少导入消息,例如:
Import "fastapi" could not be resolvedPylancereportMissingImports导入“fastapi”无法解决PylancereportMissingImports
The imports always work perfectly fine, the fastapi example above will run a server and I can build an API without issue.导入总是很好,上面的 fastapi 示例将运行服务器,我可以毫无问题地构建 API。
Can anyone explain why I am getting this error and how I could get rid of it?谁能解释我为什么会收到此错误以及如何摆脱它?
Reinstall fastapi again separately.单独重新安装 fastapi。
pip install 'fastapi[all]' pip 安装
'fastapi[all]'
pip install fastapi
pip install uvicorn
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.