How to run tensorflow in atom?

#1

I already install tensorflow with pip.
I can run the code in python IDE, and success in the shell
But when I use the Atom with atom runner, it always says “ImportError: No module named tensorflow”
Can anybody tell me what’s going on?

import tensorflow as tf
hello = tf.constant(‘Hello, TensorFlow!’)
sess = tf.Session()
print(sess.run(hello))

#2

There’s a solid chance that you have multiple different versions of Python on your system and the one that the python command points at is not the one with a site-packages/tensorflow/ folder. The first thing to test is to open up Terminal and test whether python Test_tensorflow.py works.

1 Like
#3

Actually it doesn’t work. What should I do? Reinstall ?

#4

Reinstall what, exactly?

When you installed tensorflow, did you do it from within the Python IDE or the command line?

#5

The problem is solved, Thanks

#6

Excuse me
Firstly I come from Chine so my english very bad
And could you tell how to run tensorflow in atom(Anaconda3 Python 3.6)
Thanks you!

#7

Choose your OS and follow the steps
https://www.tensorflow.org/install/

There has the steps of Installation with Anaconda

#8

alright I will try again

#9

So can someone explain how they got tensorflow working on atom? I’m still having trouble.

1 Like
#10

If you explain precisely what you are having trouble with and what you are trying to do, someone might be able to help you. What Atom packages, what code, and what version of Python you are using, plus any error messages you have seen, at the minimum. If you have a goal for what your workflow should look like and can articulate a broader vision of how you want to accomplish your work, I can offer an even more customized solution.

#11

I’m having the same problem when trying to use tensorflow in atom. Anyone please?

#12

I’m trying to run my code and it gives this error:

Traceback (most recent call last):

File “/Users/Macbookpro/Documents/GitHub/DPED/test_model.py”, line 5, in
import tensorflow as tf
ImportError: No module named tensorflow
[Finished in 4.124s]

#13

Trouble with tensorflow in Atom, or in general? I.e., does it work when running from the command line?

1 Like
#14

tried and reinstalling according to the website : https://www.tensorflow.org/install also. But when typed

    Macbookpro$ python Test_tensorflow.py
python: can't open file 'Test_tensorflow.py': [Errno 2] No such file or directory
#15

You need to be inside the folder where your file is in order to run it like that.

Try python --version, also, to make sure you’re using the right version.