虽然我已经在 vs code 中安装并更新了 python 和tensorflow,但我仍然收到此错误:
"message": "Import \"tensorflow\" could not be resolved",
这是从线上发生的:
import tensorflow as tf
我尝试修复解释器,我从 homebrew 安装了它并将其设置为我的路径:
% which python3
/opt/homebrew/bin/python3
py version: 3.11.7
tf version: 2.15.0
如果您使用的是 conda,请检查环境是否为您的项目设置了环境。设置环境后,使用
检查该环境中是否安装了tensorflow