Unable to run what-if tool commands in jupyter notebook in Anaconda environment on Windows10

57 views
Skip to first unread message

agarwal...@gmail.com

unread,
Feb 12, 2020, 4:13:21 AM2/12/20
to What-If Tool
Hi,

I am trying to do what-if tool setup in my windows10 machine

I am following the instructions given at : https://github.com/pair-code/what-if-tool

pip install witwidget
jupyter nbextension install --py --symlink --sys-prefix witwidget
jupyter nbextension enable --py --sys-prefix witwidget
First command(pip install witwidget) is successful but following command throw error as below
(base) C:\Users\paresh.agwl>jupyter nbextension install --py --symlink --sys-prefix witwidget
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)                                      File "C:\ProgramData\Anaconda3\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)                                                                             File "C:\ProgramData\Anaconda3\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: The specified module could not be found.
                                                                                                                        During handling of the above exception, another exception occurred:
                                                                                                                        Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\Scripts\jupyter-nbextension-script.py", line 10, in <module>                               sys.exit(main())
  File "C:\ProgramData\Anaconda3\lib\site-packages\jupyter_core\application.py", line 267, in launch_instance               return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\traitlets\config\application.py", line 664, in launch_instance           app.start()
  File "C:\ProgramData\Anaconda3\lib\site-packages\notebook\nbextensions.py", line 988, in start                            super(NBExtensionApp, self).start()
  File "C:\ProgramData\Anaconda3\lib\site-packages\jupyter_core\application.py", line 256, in start                         self.subapp.start()
  File "C:\ProgramData\Anaconda3\lib\site-packages\notebook\nbextensions.py", line 716, in start                            self.install_extensions()
  File "C:\ProgramData\Anaconda3\lib\site-packages\notebook\nbextensions.py", line 695, in install_extensions               **kwargs
  File "C:\ProgramData\Anaconda3\lib\site-packages\notebook\nbextensions.py", line 211, in install_nbextension_python       m, nbexts = _get_nbextension_metadata(module)
  File "C:\ProgramData\Anaconda3\lib\site-packages\notebook\nbextensions.py", line 1122, in _get_nbextension_metadata       m = import_item(module)
  File "C:\ProgramData\Anaconda3\lib\site-packages\traitlets\utils\importstring.py", line 42, in import_item                return __import__(parts[0])
  File "C:\ProgramData\Anaconda3\lib\site-packages\witwidget\__init__.py", line 15, in <module>
    from witwidget.notebook.visualization import *
  File "C:\ProgramData\Anaconda3\lib\site-packages\witwidget\notebook\visualization.py", line 17, in <module>               import tensorflow as tf
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 101, in <module>                           from tensorflow_core import *
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\__init__.py", line 40, in <module>                       from tensorflow.python.tools import module_util as _module_util
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__                         module = self._load()
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 44, in _load                               module = _importlib.import_module(self.__name__)
  File "C:\ProgramData\Anaconda3\lib\importlib\__init__.py", line 127, in import_module                                     return _bootstrap._gcd_import(name[level:], package, level)
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\python\__init__.py", line 49, in <module>                from tensorflow.python import pywrap_tensorflow
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 74, in <module>       raise ImportError(msg)
ImportError: Traceback (most recent call last):                                                                           File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *                                                            File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>                                                                                                                      _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)                                      File "C:\ProgramData\Anaconda3\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)                                                                             File "C:\ProgramData\Anaconda3\lib\imp.py", line 342, in load_dynamic
    return _load(spec)                                                                                                  ImportError: DLL load failed: The specified module could not be found.

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/errors
for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.

(base) C:\Users\paresh.agwl>

I am not sure what is this issue and missing dependencies in my system. I tried same setup in Ubuntu 18.04 installation was successful.
Please help me to resolve this issue as I am struck and unable to use what-if tool


jwe...@google.com

unread,
Feb 13, 2020, 2:39:54 PM2/13/20
to What-If Tool

Thanks for reaching out. This seems to be an error with the TensorFlow installation not working correctly inside your anaconda environment on Windows (witwidget has a pip package dependency on tensorflow). Have you previously used tensorflow in this environment before? I imagine you would get the same error in your environment if you pip installed tensorflow and tried to do an "import tensorflow" statement in a python module.

Here is a stackoverflow link of others dealing with similar-sounding tensorflow install issues on windows and possible solutions: https://stackoverflow.com/questions/42011070/on-windows-running-import-tensorflow-generates-no-module-named-pywrap-tenso

Let me know if any of the possible solutions in that link help you get past that error.

-James
Reply all
Reply to author
Forward
0 new messages