TensorFlow 2.1.0 Installation (Issues and Fixes)


Issue in installation of TensorFlow in Anaconda Prompt on Windows 10 (Mar 2020):

(base) C:\Users\ashish>python
Python 3.7.1 (default, Dec 10 2018, 22:54:23) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
Traceback (most recent call last):
  File "", line 1, in 
ModuleNotFoundError: No module named 'tensorflow'
>>> exit()

(base) C:\Users\ashish>pip install tensorflow
Collecting tensorflow
  Using cached https://files.pythonhosted.org/packages/34/d5/ce8c17971067c0184c9045112b755be5461d5ce5253ef65a367e1298d7c5/tensorflow-2.1.0-cp37-cp37m-win_amd64.whl
Collecting keras-applications>=1.0.8 (from tensorflow)
  Using cached https://files.pythonhosted.org/packages/71/e3/19762fdfc62877ae9102edf6342d71b28fbfd9dea3d2f96a882ce099b03f/Keras_Applications-1.0.8-py3-none-any.whl
Requirement already satisfied: tensorboard<2.2.0,>=2.1.0 in c:\users\ashish\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow) (2.1.1)
Requirement already satisfied: protobuf>=3.8.0 in c:\users\ashish\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow) (3.11.3)
Collecting tensorflow-estimator<2.2.0,>=2.1.0rc0 (from tensorflow)
  Using cached https://files.pythonhosted.org/packages/18/90/b77c328a1304437ab1310b463e533fa7689f4bfc41549593056d812fab8e/tensorflow_estimator-2.1.0-py2.py3-none-any.whl
Collecting astor>=0.6.0 (from tensorflow)
  Using cached https://files.pythonhosted.org/packages/c3/88/97eef84f48fa04fbd6750e62dcceafba6c63c81b7ac1420856c8dcc0a3f9/astor-0.8.1-py2.py3-none-any.whl
Collecting wrapt>=1.11.1 (from tensorflow)
Requirement already satisfied: absl-py>=0.7.0 in c:\users\ashish\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow) (0.9.0)
Requirement already satisfied: wheel>=0.26; python_version >= "3" in c:\users\ashish\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow) (0.32.3)
Requirement already satisfied: numpy<2.0,>=1.16.0 in c:\users\ashish\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow) (1.18.1)
Collecting gast==0.2.2 (from tensorflow)
Requirement already satisfied: opt-einsum>=2.3.2 in c:\users\ashish\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow) (3.2.0)
Requirement already satisfied: grpcio>=1.8.6 in c:\users\ashish\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow) (1.27.2)
Collecting google-pasta>=0.1.6 (from tensorflow)
  Using cached https://files.pythonhosted.org/packages/c3/fd/1e86bc4837cc9a3a5faf3db9b1854aa04ad35b5f381f9648fbe81a6f94e4/google_pasta-0.1.8-py3-none-any.whl
Requirement already satisfied: termcolor>=1.1.0 in c:\users\ashish\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow) (1.1.0)
Collecting keras-preprocessing>=1.1.0 (from tensorflow)
  Using cached https://files.pythonhosted.org/packages/28/6a/8c1f62c37212d9fc441a7e26736df51ce6f0e38455816445471f10da4f0a/Keras_Preprocessing-1.1.0-py2.py3-none-any.whl
Requirement already satisfied: six>=1.12.0 in c:\users\ashish\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow) (1.12.0)
Requirement already satisfied: scipy==1.4.1; python_version >= "3" in c:\users\ashish\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow) (1.4.1)
Requirement already satisfied: h5py in c:\users\ashish\appdata\local\continuum\anaconda3\lib\site-packages (from keras-applications>=1.0.8->tensorflow) (2.8.0)
Requirement already satisfied: setuptools>=41.0.0 in c:\users\ashish\appdata\local\continuum\anaconda3\lib\site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow) (46.0.0)
Requirement already satisfied: markdown>=2.6.8 in c:\users\ashish\appdata\local\continuum\anaconda3\lib\site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow) (3.2.1)
Requirement already satisfied: google-auth<2,>=1.6.3 in c:\users\ashish\appdata\local\continuum\anaconda3\lib\site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow) (1.6.3)
Requirement already satisfied: werkzeug>=0.11.15 in c:\users\ashish\appdata\local\continuum\anaconda3\lib\site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow) (0.16.1)
Requirement already satisfied: requests<3,>=2.21.0 in c:\users\ashish\appdata\local\continuum\anaconda3\lib\site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow) (2.21.0)
Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in c:\users\ashish\appdata\local\continuum\anaconda3\lib\site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow) (0.4.1)
Requirement already satisfied: cachetools>=2.0.0 in c:\users\ashish\appdata\local\continuum\anaconda3\lib\site-packages (from google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow) (3.1.0)
Requirement already satisfied: rsa>=3.1.4 in c:\users\ashish\appdata\local\continuum\anaconda3\lib\site-packages (from google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow) (4.0)
Requirement already satisfied: pyasn1-modules>=0.2.1 in c:\users\ashish\appdata\local\continuum\anaconda3\lib\site-packages (from google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow) (0.2.5)
Requirement already satisfied: idna<2.9,>=2.5 in c:\users\ashish\appdata\local\continuum\anaconda3\lib\site-packages (from requests<3,>=2.21.0->tensorboard<2.2.0,>=2.1.0->tensorflow) (2.8)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in c:\users\ashish\appdata\local\continuum\anaconda3\lib\site-packages (from requests<3,>=2.21.0->tensorboard<2.2.0,>=2.1.0->tensorflow) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\ashish\appdata\local\continuum\anaconda3\lib\site-packages (from requests<3,>=2.21.0->tensorboard<2.2.0,>=2.1.0->tensorflow) (2018.11.29)
Requirement already satisfied: urllib3<1.25,>=1.21.1 in c:\users\ashish\appdata\local\continuum\anaconda3\lib\site-packages (from requests<3,>=2.21.0->tensorboard<2.2.0,>=2.1.0->tensorflow) (1.24.1)
Requirement already satisfied: requests-oauthlib>=0.7.0 in c:\users\ashish\appdata\local\continuum\anaconda3\lib\site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.2.0,>=2.1.0->tensorflow) (1.3.0)
Requirement already satisfied: pyasn1>=0.1.3 in c:\users\ashish\appdata\local\continuum\anaconda3\lib\site-packages (from rsa>=3.1.4->google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow) (0.4.5)
Requirement already satisfied: oauthlib>=3.0.0 in c:\users\ashish\appdata\local\continuum\anaconda3\lib\site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.2.0,>=2.1.0->tensorflow) (3.1.0)
thinc 6.12.1 has requirement wrapt<1.11.0,>=1.10.0, but you'll have wrapt 1.12.1 which is incompatible.
Installing collected packages: keras-applications, tensorflow-estimator, astor, wrapt, gast, google-pasta, keras-preprocessing, tensorflow
  Found existing installation: wrapt 1.10.11
Cannot uninstall 'wrapt'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

(base) C:\Users\ashish>

Faced no such issues on Ubuntu: 
(base) ashish@ashish-vBox:~/Desktop/workspace/VisualStudioCode$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 19.10
Release: 19.10
Codename: eoan

~ ~ ~

(base) ashish@ashish-vBox:~/Desktop/workspace/VisualStudioCode$ python
Python 3.7.3 (default, Mar 27 2019, 22:11:17) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
Traceback (most recent call last):
  File "", line 1, in 
ModuleNotFoundError: No module named 'tensorflow'
>>> exit()

(base) ashish@ashish-vBox:~/Desktop/workspace/VisualStudioCode$ pip install tensorflow
Collecting tensorflow
  Downloading https://files.pythonhosted.org/packages/1d/56/0dbdae2a3c527a119bec0d5cf441655fe030ce1daa6fa6b9542f7dbd8664/tensorflow-2.1.0-cp37-cp37m-manylinux2010_x86_64.whl (421.8MB)
     |████████████████████████████████| 421.8MB 72kB/s 
Collecting astor>=0.6.0 (from tensorflow)
  Downloading https://files.pythonhosted.org/packages/c3/88/97eef84f48fa04fbd6750e62dcceafba6c63c81b7ac1420856c8dcc0a3f9/astor-0.8.1-py2.py3-none-any.whl
Collecting opt-einsum>=2.3.2 (from tensorflow)
  Downloading https://files.pythonhosted.org/packages/b2/49/2233e63052d5686c72131b579837ddfb98ba9dd0b92bb91efcb441ada8ce/opt_einsum-3.2.0-py3-none-any.whl (63kB)
     |████████████████████████████████| 71kB 526kB/s 
Collecting tensorboard<2.2.0,>=2.1.0 (from tensorflow)
  Downloading https://files.pythonhosted.org/packages/d9/41/bbf49b61370e4f4d245d4c6051dfb6db80cec672605c91b1652ac8cc3d38/tensorboard-2.1.1-py3-none-any.whl (3.8MB)
     |████████████████████████████████| 3.9MB 2.4MB/s 
Collecting google-pasta>=0.1.6 (from tensorflow)
  Downloading https://files.pythonhosted.org/packages/c3/fd/1e86bc4837cc9a3a5faf3db9b1854aa04ad35b5f381f9648fbe81a6f94e4/google_pasta-0.1.8-py3-none-any.whl (57kB)
     |████████████████████████████████| 61kB 505kB/s 
Collecting tensorflow-estimator<2.2.0,>=2.1.0rc0 (from tensorflow)
  Downloading https://files.pythonhosted.org/packages/18/90/b77c328a1304437ab1310b463e533fa7689f4bfc41549593056d812fab8e/tensorflow_estimator-2.1.0-py2.py3-none-any.whl (448kB)
     |████████████████████████████████| 450kB 804kB/s 
Collecting keras-applications>=1.0.8 (from tensorflow)
  Downloading https://files.pythonhosted.org/packages/71/e3/19762fdfc62877ae9102edf6342d71b28fbfd9dea3d2f96a882ce099b03f/Keras_Applications-1.0.8-py3-none-any.whl (50kB)
     |████████████████████████████████| 51kB 772kB/s 
Collecting keras-preprocessing>=1.1.0 (from tensorflow)
  Downloading https://files.pythonhosted.org/packages/28/6a/8c1f62c37212d9fc441a7e26736df51ce6f0e38455816445471f10da4f0a/Keras_Preprocessing-1.1.0-py2.py3-none-any.whl (41kB)
     |████████████████████████████████| 51kB 3.2MB/s 
Requirement already satisfied: numpy<2.0,>=1.16.0 in /home/ashish/anaconda3/lib/python3.7/site-packages (from tensorflow) (1.16.4)
Requirement already satisfied: wrapt>=1.11.1 in /home/ashish/anaconda3/lib/python3.7/site-packages (from tensorflow) (1.11.2)
Collecting grpcio>=1.8.6 (from tensorflow)
  Downloading https://files.pythonhosted.org/packages/fb/00/997acb1c16f84e6d3ede511500f54e7b7a1fdfe7b4da5a5c2d07ad4e91f1/grpcio-1.27.2-cp37-cp37m-manylinux2010_x86_64.whl (2.7MB)
     |████████████████████████████████| 2.7MB 758kB/s 
Collecting scipy==1.4.1; python_version >= "3" (from tensorflow)
  Downloading https://files.pythonhosted.org/packages/dd/82/c1fe128f3526b128cfd185580ba40d01371c5d299fcf7f77968e22dfcc2e/scipy-1.4.1-cp37-cp37m-manylinux1_x86_64.whl (26.1MB)
     |████████████████████████████████| 26.1MB 81kB/s 
Requirement already satisfied: six>=1.12.0 in /home/ashish/anaconda3/lib/python3.7/site-packages (from tensorflow) (1.12.0)
Collecting termcolor>=1.1.0 (from tensorflow)
  Downloading https://files.pythonhosted.org/packages/8a/48/a76be51647d0eb9f10e2a4511bf3ffb8cc1e6b14e9e4fab46173aa79f981/termcolor-1.1.0.tar.gz
Collecting gast==0.2.2 (from tensorflow)
  Downloading https://files.pythonhosted.org/packages/4e/35/11749bf99b2d4e3cceb4d55ca22590b0d7c2c62b9de38ac4a4a7f4687421/gast-0.2.2.tar.gz
Requirement already satisfied: wheel>=0.26; python_version >= "3" in /home/ashish/anaconda3/lib/python3.7/site-packages (from tensorflow) (0.33.4)
Collecting absl-py>=0.7.0 (from tensorflow)
  Downloading https://files.pythonhosted.org/packages/1a/53/9243c600e047bd4c3df9e69cfabc1e8004a82cac2e0c484580a78a94ba2a/absl-py-0.9.0.tar.gz (104kB)
     |████████████████████████████████| 112kB 1.6MB/s 
Collecting protobuf>=3.8.0 (from tensorflow)
  Downloading https://files.pythonhosted.org/packages/ff/f1/8dcd4219bbae8aa44fe8871a89f05eca2dca9c04f8dbfed8a82b7be97a88/protobuf-3.11.3-cp37-cp37m-manylinux1_x86_64.whl (1.3MB)
     |████████████████████████████████| 1.3MB 54kB/s 
Requirement already satisfied: werkzeug>=0.11.15 in /home/ashish/anaconda3/lib/python3.7/site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow) (0.15.4)
Requirement already satisfied: setuptools>=41.0.0 in /home/ashish/anaconda3/lib/python3.7/site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow) (41.0.1)
Collecting google-auth-oauthlib<0.5,>=0.4.1 (from tensorboard<2.2.0,>=2.1.0->tensorflow)
  Downloading https://files.pythonhosted.org/packages/7b/b8/88def36e74bee9fce511c9519571f4e485e890093ab7442284f4ffaef60b/google_auth_oauthlib-0.4.1-py2.py3-none-any.whl
Collecting google-auth<2,>=1.6.3 (from tensorboard<2.2.0,>=2.1.0->tensorflow)
  Downloading https://files.pythonhosted.org/packages/5a/8d/e2ebbd0502627ed0d8a408162020e1c0792f088b49fddeedaaeebc206ed7/google_auth-1.11.2-py2.py3-none-any.whl (76kB)
     |████████████████████████████████| 81kB 1.3MB/s 
Collecting markdown>=2.6.8 (from tensorboard<2.2.0,>=2.1.0->tensorflow)
  Downloading https://files.pythonhosted.org/packages/ab/c4/ba46d44855e6eb1770a12edace5a165a0c6de13349f592b9036257f3c3d3/Markdown-3.2.1-py2.py3-none-any.whl (88kB)
     |████████████████████████████████| 92kB 1.2MB/s 
Requirement already satisfied: requests<3,>=2.21.0 in /home/ashish/anaconda3/lib/python3.7/site-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow) (2.22.0)
Requirement already satisfied: h5py in /home/ashish/anaconda3/lib/python3.7/site-packages (from keras-applications>=1.0.8->tensorflow) (2.9.0)
Collecting requests-oauthlib>=0.7.0 (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.2.0,>=2.1.0->tensorflow)
  Downloading https://files.pythonhosted.org/packages/a3/12/b92740d845ab62ea4edf04d2f4164d82532b5a0b03836d4d4e71c6f3d379/requests_oauthlib-1.3.0-py2.py3-none-any.whl
Requirement already satisfied: pyasn1-modules>=0.2.1 in /home/ashish/anaconda3/lib/python3.7/site-packages (from google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow) (0.2.7)
Collecting cachetools<5.0,>=2.0.0 (from google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow)
  Downloading https://files.pythonhosted.org/packages/08/6a/abf83cb951617793fd49c98cb9456860f5df66ff89883c8660aa0672d425/cachetools-4.0.0-py3-none-any.whl
Collecting rsa<4.1,>=3.1.4 (from google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow)
  Downloading https://files.pythonhosted.org/packages/02/e5/38518af393f7c214357079ce67a317307936896e961e35450b70fad2a9cf/rsa-4.0-py2.py3-none-any.whl
Requirement already satisfied: idna<2.9,>=2.5 in /home/ashish/anaconda3/lib/python3.7/site-packages (from requests<3,>=2.21.0->tensorboard<2.2.0,>=2.1.0->tensorflow) (2.8)
Requirement already satisfied: certifi>=2017.4.17 in /home/ashish/anaconda3/lib/python3.7/site-packages (from requests<3,>=2.21.0->tensorboard<2.2.0,>=2.1.0->tensorflow) (2019.6.16)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /home/ashish/anaconda3/lib/python3.7/site-packages (from requests<3,>=2.21.0->tensorboard<2.2.0,>=2.1.0->tensorflow) (3.0.4)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /home/ashish/anaconda3/lib/python3.7/site-packages (from requests<3,>=2.21.0->tensorboard<2.2.0,>=2.1.0->tensorflow) (1.24.2)
Collecting oauthlib>=3.0.0 (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.2.0,>=2.1.0->tensorflow)
  Downloading https://files.pythonhosted.org/packages/05/57/ce2e7a8fa7c0afb54a0581b14a65b56e62b5759dbc98e80627142b8a3704/oauthlib-3.1.0-py2.py3-none-any.whl (147kB)
     |████████████████████████████████| 153kB 1.6MB/s 
Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in /home/ashish/anaconda3/lib/python3.7/site-packages (from pyasn1-modules>=0.2.1->google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow) (0.4.8)
Building wheels for collected packages: termcolor, gast, absl-py
  Building wheel for termcolor (setup.py) ... done
  Stored in directory: /home/ashish/.cache/pip/wheels/7c/06/54/bc84598ba1daf8f970247f550b175aaaee85f68b4b0c5ab2c6
  Building wheel for gast (setup.py) ... done
  Stored in directory: /home/ashish/.cache/pip/wheels/5c/2e/7e/a1d4d4fcebe6c381f378ce7743a3ced3699feb89bcfbdadadd
  Building wheel for absl-py (setup.py) ... done
  Stored in directory: /home/ashish/.cache/pip/wheels/8e/28/49/fad4e7f0b9a1227708cbbee4487ac8558a7334849cb81c813d
Successfully built termcolor gast absl-py
Installing collected packages: astor, opt-einsum, grpcio, absl-py, protobuf, cachetools, rsa, google-auth, oauthlib, requests-oauthlib, google-auth-oauthlib, markdown, tensorboard, google-pasta, tensorflow-estimator, keras-applications, keras-preprocessing, scipy, termcolor, gast, tensorflow
  Found existing installation: scipy 1.3.0
    Uninstalling scipy-1.3.0:
      Successfully uninstalled scipy-1.3.0
Successfully installed absl-py-0.9.0 astor-0.8.1 cachetools-4.0.0 gast-0.2.2 google-auth-1.11.2 google-auth-oauthlib-0.4.1 google-pasta-0.1.8 grpcio-1.27.2 keras-applications-1.0.8 keras-preprocessing-1.1.0 markdown-3.2.1 oauthlib-3.1.0 opt-einsum-3.2.0 protobuf-3.11.3 requests-oauthlib-1.3.0 rsa-4.0 scipy-1.4.1 tensorboard-2.1.1 tensorflow-2.1.0 tensorflow-estimator-2.1.0 termcolor-1.1.0
(base) ashish@ashish-vBox:~/Desktop/workspace/VisualStudioCode$ 

~ ~ ~

Testing: 

(base) ashish@ashish-vBox:~/Desktop/workspace/VisualStudioCode$ python
Python 3.7.3 (default, Mar 27 2019, 22:11:17) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
2020-03-11 13:27:05.840690: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libnvinfer.so.6'; dlerror: libnvinfer.so.6: cannot open shared object file: No such file or directory
2020-03-11 13:27:05.840856: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libnvinfer_plugin.so.6'; dlerror: libnvinfer_plugin.so.6: cannot open shared object file: No such file or directory
2020-03-11 13:27:05.840876: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:30] Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
>>> tensorflow

>>> tensorflow.__version__
'2.1.0'
>>> exit()

(base) ashish@ashish-vBox:~/Desktop/workspace/VisualStudioCode$

No comments:

Post a Comment