【发布时间】:2016-06-05 21:02:10
【问题描述】:
我正在尝试导入 tensorflow(我已经安装在 14.04 LTS 和 tensorflow 0.8 上)但它显示了
atributeError: module 'imp' has no attribute 'find_module'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/prayalankar/anaconda3/envs/tensorflow/lib/python3.5/site-packages/tensorflow/\__init__.py", line 23, in <module>
from tensorflow.python import *
File "/home/prayalankar/anaconda3/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/\__init__.py", line 45, in <module>
from tensorflow.python import pywrap_tensorflow
File "/home/prayalankar/anaconda3/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "/home/prayalankar/anaconda3/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow.py", line 18, in swig_import_helper
fp, pathname, description = imp.find_module('_pywrap_tensorflow', [dirname(\__file__)])
AttributeError: module 'imp' has no attribute 'find_module'
如何进行?
【问题讨论】:
-
你是怎么安装的?请写详细。可能是安装过程中出现了一些错误?
-
我使用 anaconda 安装。首先,我在 anaconda 中创建了一个新环境。在阅读了来自 tensorflow github 的问题后,下载了 storage.googleapis.com/tensorflow/linux/cpu/… 并将 cp34-cp34m 更改为 py3。然后它被安装了。它给出了错误“No Flask”我解决了之后它给出了上述错误
-
发布所有安装日志。
-
顺便说一句,Python 3 支持的测试不如 Python 2,你可以先尝试让它与 Python 2.7 一起工作
-
谢谢@Yaroslav Bulatov 在您发表评论后,我使用 conda 环境安装了 tensorflow i python 2.x,我准备在 15 分钟内开始使用。谢谢
标签: python-3.x tensorflow