0
votes

I installed TensorFlow and Anaconda on my macbook pro and it seems to work fine, I can import tensorflow and execute commands on the command line, however I would like to use tensorflow in IPython notebooks. When I go to Anaconda Navigator -> environments - > TensorFlow, you can click the little arrow to "open terminal", "open with python" (both work fine) OR "open with IPython", "open with Jupyter Notebook". The last two options are disabled for some reason which I can't figure out. How do I enable them?

1
Did you install jupyter into your TensorFlow environment? - cel
No. I thought it'd be there since I do see a Jupyter Notebook icon on the Home button in Anaconda Navigator and it works fine, but I don't see it in the list of installed packages under tensorflow environment. I'm confused.. - Kai
You need to install all the packages you want to use into each environment where you want to use them. Conda tries to make each environment as independent as possible. Simply writing conda install -n tensorflow notebook ipython should work. - darthbith
Ok, I installed Jupyter under the tensorflow environment by launching a terminal (from tensorflow environment arrow in Navigator) and executing the command: {conda install --name tensorflow jupyter}. Now I can see the two notebook options enabled and I can launch a Jupyter notebook fine, however I can't import tensorflow into it. Getting an {ImportError: No module named tensorflow}. The IPython shell (option 3) imports tensorflow just fine and I can create a session and execute TF commands just fine. Not sure what's going on with Jupyter notebook. - Kai
What's the output of printing sys.path? - darthbith

1 Answers

0
votes

OK, so installing Jupyter with the tensorflow environment was required to activate the two ipython/Jupyter Notebook selection in Anaconda Navigator (as advised by @darthbith ). As for the import error, I found a workaround, NOT a solution, which is to activate the tensorflow environment in a terminal, then launching a Jupyter notebook from that terminal. Then I was able to import and use tensorflow in my Jupyter notebook. In addition, all imports are now looking at the tensorflow environment not the "root" environment. I'm Happy!!