2

I am trying to install Tensorflow on Windows 10 using Anaconda3.

I get the following error message after every attempt.

 "Command "python setup.py egg_info" failed with error code 
 3221226505 in C:\Users\user\AppData\Local\Temp\pip-install- 
 8j_eg21o\termcolor\"

I Create a new Anaconda Container and tried running the following.

 "python -m pip install tensorflow"
 "python -m pip install tensorflow==1.7.1"
 "python -m pip install --upgrade tensorflow"

There are some information on the internet stating my Setup Tools is out of date. I tried to correct this by using the Following commands.

 "pip install --upgrade setuptools"
 "python -m pip install --upgrade pip"

It does not correct the error message. Is there any Python Guru's that will be able to solve my issue? Thanks in advance.

Quentin
  • 900
  • 8
  • 13

2 Answers2

2

Anaconda is there for such issues. You ought not use pip to install packages unless it is the last resort. conda helps you avoid colliding packages. Do:

conda update conda
conda create -n tensor python=3.6

We first updated conda, and then created an environment called tensor that has Python 3.6.

To activate our environment, install and test if we can use tensorflow, do:

conda activate tensor
conda config --append channels conda-forge
conda install tensorflow 
python -c "import tensorflow"

This activates our environment (tensor), appended conda-forge channel, install tensorflow and test if we can import tensorflow.

To add other packages e.g. jupyter, pandas and scikit-learn. We can do:

conda install -n tensor jupyter pandas scikit-learn

This works in or out of our tensor environment. Happy coding.

Prayson W. Daniel
  • 14,191
  • 4
  • 51
  • 57
1

According to this answer, try upgrading setuptools via ,

easy_install -U setuptools

Since you want to install TensorFlow in an Anaconda environment, I would suggest installing a Conda package. You can read the instructions here. Installing pip packages invite problems for some packages. Install the TensorFlow Conda package using,

conda install -c conda-forge tensorflow

The conda packages must work as expected.

Shubham Panchal
  • 4,061
  • 2
  • 11
  • 36