gpt4 book ai didi

python - importerror 没有名为 tensorflow windows 的模块

转载 作者:太空宇宙 更新时间:2023-11-04 05:11:40 25 4
gpt4 key购买 nike

import tensorflow as tf Traceback (most recent call last):

File "<ipython-input-5-41389fad42b5>", line 1, in <module>
import tensorflow as tf

ModuleNotFoundError: No module named 'tensorflow'

使用 Windows 在 anaconda 中安装 tensorflow 后出现以下错误。我已经按照tensorflow的安装步骤做了

起初它运行正常,但当我尝试卸载并重新安装 tensorflow 时,弹出此错误。我尝试卸载 Anaconda 本身并重新安装,但无济于事。 Tensorflow 正在安装,但当我尝试导入步骤时,它显示上述错误。

最佳答案

已解决:Python 3.6 与 tensorflow 不兼容,必须为 python 3.5 创建 tensorflow 环境。

conda create -n tensorflow python=3.5 anaconda

在命令提示符下激活它并从中启动 spyder,这将我的 python 版本更改为 3.5。现在可以正确导入 tensorflow。

关于python - importerror 没有名为 tensorflow windows 的模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42846020/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com