spyder: tensorflow not working in spyder

ubuntu 14.0.4 python 3.5 anaconda3

I have installed spyder and tensorflow, I am not sure how to make the tensorflow work in the spyder IDE

I am testing simple program import tensorflow as tf sess = tf.InteractiveSession() sess.close()

when I click run it shows ImportError: No module named 'tensorflow

If I execute it with the command line (tensorflow)raady@pc:~<my folders>/ pythontest.py

it doesnt show any error.

Did I miss something while installing spyder or did i install incorrectly?

how can this issued be resolved ?

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 20 (2 by maintainers)

Most upvoted comments

@jadoonengr

I had the same problem previously, but I solved it by adding the location of the tensorflow module (C:\…\Anaconda3\envs\tensorflow\Lib\site-packages) into PYTHONPATH via the PYTHONPATH manager built into Spyder (Tools>PYTHONPATH manager).

Can you please comment on this?

Thank you.

Finally I solved this mystery. If you have installed Spyder from the Anaconda, go to the Anaconda launcher. There go to environments, you will see two of them: root and tensorflow. The latter one is created due to the instructions by tensorflow.org. Just run all those instructions on the root, don’t activate tensorflow environment, it will work. Everything will be available in spyder.

I exactly cant say what happened but I have reinstalled spyder and its working fine for now. Thanks for the help ccordoba12

@hanyao8 Had the same problem, your solution worked for me after adding the path and restarting Spyder. Thank you.

You need to start Spyder using a terminal instead of using Unity,

thank you, it works for me