I am a new users for Python and want to use tensorflow. I think I successfully installed tensorflow on my mac OSX via Anaconda. But I still can't figure out how to use tensorflow on Spyder. Could someone help me? Many thanks!
After installing Tensorflow using Anaconda based on Installing TensorFlow on Windows you must change your Environment for Spyder.
1) Open Anaconda Navigator
2) In top left corner you see Selector: "Applications on: base(root)"
3) Change: "base root" for "Tensorflow" it assumes that it was already installed based on link above
4) Install Spyder
5) Open Spyder and make your first test file:
010 import tensorflow as tf
020 hello = tf.constant('Hello, TensorFlow!')
030 sess = tf.Session()
040 print(sess.run(hello))
6) Run it in Spyder and it will work
System default python maybe used on command line, first verify that you are using the python from anaconda distro. Set up the environment variables first.
If you are not building tensorflow with GPU support. you can install tensorflow through conda in one command.
$ conda install -c https://conda.anaconda.org/jjhelmus tensorflow
in Spyder: import tensorflow as tf. and you're good to go.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With