我安装并更新了 python(路径集)和 Tensorflow,但 Tensorflow 不导入

问题描述 投票:0回答:1

虽然我已经在 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
tensorflow deep-learning artificial-intelligence
1个回答
0
投票

如果您使用的是 conda,请检查环境是否为您的项目设置了环境。设置环境后,使用

检查该环境中是否安装了tensorflow
© www.soinside.com 2019 - 2024. All rights reserved.