3

Tried to install tensorflow using conda and its throwing a spec conflict error. I do not have python 3.5 installed

conda install -c conda-forge tensorflow
Fetching package metadata ...............
Solving package specifications: .

UnsatisfiableError: The following specifications were found to be in conflict:
  - python 3.6*
  - tensorflow -> python 3.5*
Use "conda info <package>" to see the dependencies for each package.

python --version Python 3.6.0 :: Anaconda custom (64-bit)

I cannot seem to run tensorflow on the normal python IDE and it says module not found. So I installed Anaconda and everything seems good except for tensorflow. Any way to install this?

X10nD
  • 21,638
  • 45
  • 111
  • 152
  • You seem to be installing tensorflow for python3.5 on a python3.6 environment. Try creating a python 3.5 environment with all the anaconda packages installed and install tensorflow... – Raja Sattiraju May 29 '17 at 10:55
  • ´conda create -n Tensorflow anaconda python=3.5´.. This creates the python3.5 environment named Tensorflow with all the anaconda packages installed. Then install tensorflow for python3.5 Dont forget to activate this disctribution using ´source activate Tensorflow´ before installing TF – Raja Sattiraju May 29 '17 at 10:56
  • oh!.. Let me try that – X10nD May 29 '17 at 10:58
  • @Mechanic Can you put this as an answer. – X10nD May 29 '17 at 11:09

1 Answers1

1

You seem to be installing tensorflow for python3.5 on a python3.6 environment. I would suggest you to create a seperate python environment for tensorflow. You can do it as follows

conda create -n Tensorflow anaconda python=3.5

This will create a anaconda environment called Tensorflow and install all the anaconda packages. You can also specify any other python distribution of your choice. Be sure you download the right tensorflow distribution depending on the python version you choose.

Then activate the newly created anaconda environment as follows

source activate Tensorflow

On windows

activate Tensorflow

This will switch the python environment. Then proceed to installing Tensorflow using pip as follows

pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.1.0-cp35-cp35m-win_amd64.whl

If you wish to install tensorflow with GPU support, you should install CUDA toolkit and the CUDNNv5.1. More details here

Raja Sattiraju
  • 1,262
  • 1
  • 20
  • 42
  • And herein lies another problem. Proceed ([y]/n)? y I entered "Y" and the below is what I got # # To activate this environment, use: # > activate Tensorflow # # To deactivate this environment, use: # > deactivate Tensorflow # # * for power-users using bash, you must source # source activate Tensorflow 'source' is not recognized as an internal or external command, operable program or batch file. – X10nD May 29 '17 at 11:30
  • Are you using windows/ubuntu. Did u try activating the environment with ´activate Tensorflow´. Then you should install tensorflow in the same terminal – Raja Sattiraju May 29 '17 at 11:39
  • Did You use `activate Tensorflow` and then installed tensorflow from the same terminal? – Raja Sattiraju May 29 '17 at 15:10
  • 1
    Yes.... And that is how the prompt appears after activating C:\Users\x>activate TensorFlow (TensorFlow) C:\Users\x>conda install -c conda-forge tensorflow – X10nD May 29 '17 at 15:40
  • **[`pip install --ignore-installed` is harmful](https://stackoverflow.com/questions/53065940/pip-reinstall-a-package-even-if-it-exists/53066813#53066813) and will most probably lead to errors when managing packages later on. Installing from some random URL is also anything but advised** -- at least, you should provide explanation why you do that and when it will stop working -- [and it already _has_ stopped working](https://stackoverflow.com/questions/53132158/issues-with-importing-tensorflow-python-3-7-on-windows-10?noredirect=1#comment93159326_53132158). – ivan_pozdeev Nov 03 '18 at 17:04
  • As of today (20-Jan-2019), `tensorflow-gpu` is supported for `python 3.6`, but not yet for `python 3.7` – Nagabhushan S N Jan 20 '19 at 14:26