gpt4 book ai didi

python - 使用 python pip 在 Windows 中的 Tensorflow

转载 作者:可可西里 更新时间:2023-11-01 11:46:15 26 4
gpt4 key购买 nike

使用 pip 命令安装了 python 3.5.2 和 tensorflow,但在导入 tensorflow 包时出错。使用命令 as import tensorflow as tf 导入 tensorflow。但是出现错误;

追溯(最近的调用最后):

文件“”,第 1 行,在

导入错误:没有名为“tensorflow”的模块

如何纠正这个错误?我能尽快得到答案吗..

最佳答案

您是在 IDE、ipython 还是 Jupyter 上运行?如果是,则 IDE 可能正在使用不同的 python,例如 virtualenv。您的系统中可能安装了多个 python。

打开 cmd 并尝试以下操作

$ where python
$ python -c "import tensorflow"

请确保您获取的路径与安装路径相同。

如果还是有错误,就和这条路径比较

$ where pip

如果有多个 python,您的系统可能使用了不同的 python 路径。

关于python - 使用 python pip 在 Windows 中的 Tensorflow,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44055742/

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