1
votes

I am running ubuntu 14.04 with an anaconda2 installation and would like to use tensorflow in combination with CUDA. So far the steps I performed are:

  1. Installed CUDA 7.5 and cudnn
  2. Installed tensorflow (GPU version) through a DEB package. Note that I don't want to use the conda package of tensorflow since that one is not the GPU version.
  3. Added Anaconda, CUDA and cudnn to path.
  4. Created a conda environment for tensorflow (conda create -n tensorflow python=2.7)

Now if I start python or IDLE from the terminal, I can import tensorflow and it will find all the CUDA dependencies, great!

...however, if I start ipython or spyder from the same terminal, running "import tensorflow as tf" gives me a cold-hearted "ImportError: No module named tensorflow".

My question: How can I get ipython and spyder to find the tensorflow library just like in an IDLE and a python instance?

1
Are you sure that the they use the same python environment?Bonifacio2
Spyder is pointing to ~/anaconda2/bin/python as its python executable. My tensorflow is installed in ~/anaconda2/envs/tensorflow/bin. Seems like it's the same environment? Or am I missing something?Mustafa Radha
Update. Ok, I think I got it. So apparently within the tensorflow environment I was able to install ipython again and now it does recognize tensorflow. Same trick did not solve it for spyder though.Mustafa Radha
Do you have spyder and ipython installed in your tensorflow environment? What is the output of source activate tensorflow && conda list?Eric Dill

1 Answers

0
votes

To solve your issue you have 3 options here:

1 just start spyder from terminal

2 move PATH variable definition from .bash_profile to session init scripts

3 Duplicate your PATH in spyder's run configuration