2

Over the years, I always stumbled with the installation of tensorflow. I really love this library but at the same time, I also really hate it because it is so difficult to make it work. I can install it but I always have an error when running it. Can anyone make it easy to install and make it work considering it is so popular?

I spend almost the whole day today figuring out the installation issue with tensorflow. This morning I got a conflict issue with scipy, DLL stuff which I posted it twice already from last night.

failed to install tensorflow with a lot of package conflicts

statsmodels: ImportError: DLL load failed while importing _arpack: The specified procedure could not be found

I eventually decided to start from scratch and create new environments with python 3.6.10 and then installed tensorflow first, then added matplotlib, pandas, statsmodels, etc. I am still stuck now

File "C:\Users\test\miniconda3\envs\dash36\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'tensorflow_core.estimator'

then I tried to print a version of tensorflow-estimator to see conflict. and I got another error.

>>> import tensorflow-estimator
  File "<stdin>", line 1
    import tensorflow-estimator
SyntaxError: invalid syntax

can anyone please help me with the installation of tensorflow? could you please tell me which python version, tensorflow version, numpy/scipy version, scikit-learn version? I am going to work with plotly dash. which dash version also works with tensorflow?

Thank you so much

Innat
  • 16,113
  • 6
  • 53
  • 101
roudan
  • 3,082
  • 5
  • 31
  • 72
  • 1
    Note that `tensorflow-estimator` can not be the name of a python module because it contains a dash and can therefore not be an identifier, much like you can not write `foo-bar = 42`. – SebDieBln Jan 28 '22 at 00:32
  • Thanks SebDieBin, then can I do this: import tensorflow_estimator, then I got an error of ModuleNotFoundError: No module named 'tensorflow_core.estimator – roudan Jan 28 '22 at 01:51
  • 1
    There is a post related to `tensorflow-estimator`: https://stackoverflow.com/questions/66022256/modulenotfounderror-no-module-named-tensorflow-core-estimator-for-tensorflow But my suggestion is, if you gonna install tensorflow, always do it in a new environment. If it still not working, you can try using colab. – wong.lok.yin Jan 28 '22 at 02:26
  • Thanks Jason, for tensorflow 2.4 or higher, which python version is compatible? 3.7 or 3.8? – roudan Jan 28 '22 at 02:43
  • 1
    Have you considered using a ready to use Docker image with TF installed? https://hub.docker.com/r/tensorflow/tensorflow/ – ai2ys Jan 29 '22 at 15:07

1 Answers1

1

Try creating new virtual environment using Python and install Tensorflow.

#Create virtual env called venv
python -m venv --system-site-packages .\venv
#Activate venv
.\venv\Scripts\activate
#Upgrade pip
pip install --upgrade pip
#Install latest Tensorflow version: Current latest version 2.8
pip install --upgrade tensorflow
#Verify the install:
python -c "import tensorflow as"