Tensorflow 导入错误:模块“imp"没有属性“find_module" [英] Tensorflow import error: module 'imp' has no attribute 'find_module'

查看:130
本文介绍了Tensorflow 导入错误:模块“imp"没有属性“find_module"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试导入 tensorflow(我已在 14.04 LTS 和 tensorflow 0.8 上安装)但它显示

I am trying to import tensorflow (I have installed on 14.04 LTS and tensorflow 0.8) but it shows

 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'

如何进行?

推荐答案

似乎我在 home 目录中有一个 imp.py 这混淆了 python 的imp,所以我不得不更改名称imp.py

Seems that I had a imp.py in home directory which was confusing the imp of python so I had to change the name of imp.py

这篇关于Tensorflow 导入错误:模块“imp"没有属性“find_module"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆