GDB
GDB

Reputation: 3579

conda install tensorflow fails with Python version exception

I’m stuck trying to install TensorFlow on a Windows 7 machine. Here’s what I’ve done so far:

> conda config --add channels conda-forge
> activate tensorflow
> conda install tensorflow

That caused this exception:

UnsatisfiableError: The following specifications were found to be in conflict: 
- python 3.6*
- tensorflow -> 
- python 3.5*

So I installed Python 3.5 then:

> deactivate py36
> activate py35
> conda install tensorflow

Same exception. I also tried running the install command from the Python35 directory without success.

UPDATE I’m not going to answer my own question because someone might come along with a better answer. I’m a .NET guy and relatively new to Python. Here’s what I did:

  1. Cleaned up my Python environment by deleting the various installs. Maybe not necessary to accomplish the objective but reduced the problem domain.
  2. Installed the latest version of Anaconda. Note: this is a Python 3.6 implementation.
  3. Created my TensorFlow environment: > conda create --name tensorflow python=3.5
  4. Activated the new environment: > activate tensorflow
  5. Checked to confirm: > conda info –envs The results of running this command should be a list of your environments with an asterisk in front of the tensorflow environment. Important note: Activating environments from PowerShell didn’t work. I had to do this in the command line window.
  6. Per the instructions on the TensorFlow site, used the following command to install TensorFlow: pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.1.0-cp35-cp35m-win_amd64.whl

According to the response to that last line the installation was a success:

Successfully installed appdirs-1.4.3 numpy-1.12.1 packaging-16.8 protobuf-3.3.0 pyparsing-2.2.0 setuptools-35.0.2 six-1.10.0 tensorflow-1.1.0 werkzeug-0.12.2 wh eel-0.29.0

I haven't been able to get it to work in a Jupyter notebook but that's a topic for another SO thread.

Upvotes: 1

Views: 1676

Answers (2)

Yahiaoui Lilya
Yahiaoui Lilya

Reputation: 1

When installing TFx on Windows, I suggest using the following versions:

  • python=3.7
  • tensorflow==2.3.0
  • tfx==0.24.1

Feel free to have a look at this blog It seems that the latest versions of Tensorflow and tfx are only compatible with Linux and macOS operating systems.

Upvotes: 0

GodfredGyimah
GodfredGyimah

Reputation: 21

This is what worked for me. It was in Windows 10 though. Currently, Tensorflow only works with 64-bit windows, not 32-bit. So, you could create a new 64-bit environment and install tensorflow in it:

set CONDA_FORCE_32BIT=
conda create --name name_of_your_created_environment python=3.5
activate name_of_your_created_environment
conda install -c conda-forge tensorflow

CONDA_FORCE_32BIT=1 sets to a 32-bit environment whilst CONDA_FORCE_32BIT= sets to a 64-bit environment.

Upvotes: 1

Related Questions