0

I am trying to install Tensorslow on my Windows 7 64 bit computer.

I have installed Anaconda with Python 3.5.

After that I did conda install theano

it is successfully done.
conda install mingw libpython
successfully done.
pip install tensorflow
Error

I am not able to install Tensorflow in the same way I installed these other packages. Am I missing something basic?

enter image description here

Aadnan Farooq A
  • 626
  • 4
  • 8
  • 19

3 Answers3

5

Ok, I've updated instructions:

*Launch your Anaconda CMD as Admin
#if tensorflow virtual env has been created, remove it first
conda remove --name tensorflow --all
conda create -n tensorflow  --python=3.5 anaconda
activate tensorflow
conda install spyder
conda install ipython
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.1-cp35-cp35m-win_amd64.whl
spyder
Allen Qin
  • 19,507
  • 8
  • 51
  • 67
  • Yes, it installed in that way but when I check the directory C:\ProgramData\Anaconda3\Lib\site-packages i couldn't found tensorflow there. Similarly, in the Spyder IPython console when i type `import tensorflow ` Traceback (most recent call last): File "", line 1, in import tensorflow ModuleNotFoundError: No module named 'tensorflow' – Aadnan Farooq A Apr 10 '17 at 06:24
  • It's likely it's installed under C:\ProgramData\Anaconda3\env\tensorflow\Lib\site-packages as we installed it in a virtual env. You also need to install Spyder and iPython in the tensorflow virtual env. At the moment you are trying to import tensorflow from iPython installed in the root env. I've updated answer. Please let me know if it works. – Allen Qin Apr 10 '17 at 06:26
  • Yes i have followed the updated steps after running the `spyder` again in the IPython console when i type `import tensorflow` it shows me same error. And the tensorflow is in the directory which you have mentioned in the env folder – Aadnan Farooq A Apr 10 '17 at 06:37
  • I've updated instructions. Please follow it step by step to see how it goes? – Allen Qin Apr 10 '17 at 07:21
1

Tensorflow on windows only works with Python 3.5 64-bit version, I don't know why doesn't work with Python > 3.5. Try this

 conda create --name newEnv python=3.5
 activate newEnv
 (newEnv)C:> pip install tensorflow

This install Tensorflow in that particular environment. For testing run

 (newEnv)C:> python
 >>>import tensorflow as tf
 >>>hello = tf.constant('Hello Tensorflow!')
 >>>sess = tf.Session()
 >>>sess.run(hello)

It should run without any error with output "Hello Tensorflow). Tested it on Windows 10 with python 3.5 64-bit and installed tensorflow 1.0.1 cpu version.

Muhammad Hannan
  • 2,389
  • 19
  • 28
0

For Windows 10 (With NVidia 840M GPU)

If you have a different GPU check here to make sure your Compute number is > 3.0. My GPU has a 5.0

Mostly following instructions from official install instructions and steps from Stack Overflow Answer

I have found most answers do not combine the full installation from a clean install.

Configure the machine first

  1. Download and install Anaconda from Download Anaconda-Windows Link
    • Installed Anaconda as User (I did not test installing as admin)
  2. Download cuDNN v5.1 (Jan 20, 2017), for CUDA 8.0
    • Requires entering your email address and signing up.
    • Unzip this folder and add the */cuda/bin folder to your %PATH%
  3. Install NVIDIA Cuda Version 8 for Windows 10
    • Also ensure this is in your path
  4. Check for missing DLL: if where MSVCP140.DLL returns nothing you may need to either add it to the path or find it here
  5. Open Anaconda CMD (with admin privilages)

Now install using conda and to test the installation

In Anaconda CMD (using Admin):

conda create -n tensorflow python=3.5 anaconda
activate tensorflow
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.1-cp35-cp35m-win_amd64.whl

In Python:

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

Also use the code in this answer to further confirm you are using the GPU

closedloop
  • 651
  • 8
  • 10