2

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'

How to proceed?

5
  • How did you install it? Pls write in detailes. Perhaps there're some errors during installation? Commented Jun 5, 2016 at 21:11
  • i installed using anaconda . First i created a new environment in anaconda . Downloaded the storage.googleapis.com/tensorflow/linux/cpu/… and changed cp34-cp34m to py3 after reading the issues from tensorflow github . Then it was installed . It gave error "No Flask " i resolved that after which it is giving above error Commented Jun 5, 2016 at 21:16
  • Publish all installation log. Commented Jun 5, 2016 at 21:17
  • BTW, Python 3 support is not as well tested as Python 2, you could try getting it working with Python 2.7 first Commented Jun 6, 2016 at 0:09
  • Thanks @Yaroslav Bulatov I installed tensorflow i python 2.x using conda environment after your comment and I am ready to go in 15 minutes . thanks Commented Jun 6, 2016 at 2:30

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.