0
votes

I am facing issue with installation of What-If tool.

Step 1 : pip install tensorflow (This completed successfully)

Step 2 : pip install witwidget (this completed successfully)

Step 3 : jupyter nbextension install --py --symlink --sys-prefix witwidget (this failed and the error log is given below)

Environment : Windows 10 Python version : 3.7.0

(base) C:\Users\ankitagarwal5>jupyter nbextension install --py --symlink --sys-prefix witwidget Traceback (most recent call last): File "C:\Users\ankitagarwal5\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Users\ankitagarwal5\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "C:\Users\ankitagarwal5\AppData\Local\Continuum\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:\Users\ankitagarwal5\AppData\Local\Continuum\anaconda3\lib\imp.py", line 243, in load_module return load_dynamic(name, filename, file) File "C:\Users\ankitagarwal5\AppData\Local\Continuum\anaconda3\lib\imp.py", line 343, 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:\Users\ankitagarwal5\AppData\Local\Continuum\anaconda3\Scripts\jupyter-nbextension-script.py", line 10, in sys.exit(main()) File "C:\Users\ankitagarwal5\AppData\Local\Continuum\anaconda3\lib\site-packages\jupyter_core\application.py", line 266, in launch_instance return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs) File "C:\Users\ankitagarwal5\AppData\Local\Continuum\anaconda3\lib\site-packages\traitlets\config\application.py", line 658, in launch_instance app.start() File "C:\Users\ankitagarwal5\AppData\Local\Continuum\anaconda3\lib\site-packages\notebook\nbextensions.py", line 988, in start super(NBExtensionApp, self).start() File "C:\Users\ankitagarwal5\AppData\Local\Continuum\anaconda3\lib\site-packages\jupyter_core\application.py", line 255, in start self.subapp.start() File "C:\Users\ankitagarwal5\AppData\Local\Continuum\anaconda3\lib\site-packages\notebook\nbextensions.py", line 716, in start self.install_extensions() File "C:\Users\ankitagarwal5\AppData\Local\Continuum\anaconda3\lib\site-packages\notebook\nbextensions.py", line 695, in install_extensions **kwargs File "C:\Users\ankitagarwal5\AppData\Local\Continuum\anaconda3\lib\site-packages\notebook\nbextensions.py", line 211, in install_nbextension_python m, nbexts = _get_nbextension_metadata(module) File "C:\Users\ankitagarwal5\AppData\Local\Continuum\anaconda3\lib\site-packages\notebook\nbextensions.py", line 1122, in _get_nbextension_metadata m = import_item(module) File "C:\Users\ankitagarwal5\AppData\Local\Continuum\anaconda3\lib\site-packages\traitlets\utils\importstring.py", line 42, in import_item return import(parts[0]) File "C:\Users\ankitagarwal5\AppData\Local\Continuum\anaconda3\lib\site-packages\witwidget__init__.py", line 15, in from witwidget.notebook.visualization import * File "C:\Users\ankitagarwal5\AppData\Local\Continuum\anaconda3\lib\site-packages\witwidget\notebook\visualization.py", line 17, in import tensorflow as tf File "C:\Users\ankitagarwal5\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow__init__.py", line 101, in from tensorflow_core import * File "C:\Users\ankitagarwal5\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow_core__init__.py", line 40, in from tensorflow.python.tools import module_util as _module_util File "C:\Users\ankitagarwal5\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow__init__.py", line 50, in getattr module = self._load() File "C:\Users\ankitagarwal5\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow__init__.py", line 44, in _load module = _importlib.import_module(self.name) File "C:\Users\ankitagarwal5\AppData\Local\Continuum\anaconda3\lib\importlib__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "C:\Users\ankitagarwal5\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow_core\python__init__.py", line 49, in from tensorflow.python import pywrap_tensorflow File "C:\Users\ankitagarwal5\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 74, in raise ImportError(msg) ImportError: Traceback (most recent call last): File "C:\Users\ankitagarwal5\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Users\ankitagarwal5\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "C:\Users\ankitagarwal5\AppData\Local\Continuum\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:\Users\ankitagarwal5\AppData\Local\Continuum\anaconda3\lib\imp.py", line 243, in load_module return load_dynamic(name, filename, file) File "C:\Users\ankitagarwal5\AppData\Local\Continuum\anaconda3\lib\imp.py", line 343, 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.

1
Practically speaking, you shouldn't be working with the base environment. Have you tried creating a virtual environment to install packages?iz_
I have not created the virtual environment. I was trying it on base environment. If I create virtual envirnoment, would I be able to use that through Jupyter Anaconda?user3205469
If you install Jupyter in the virtual environment, yes.iz_
Sorry, I forgot to ask, are you using Miniconda or Anaconda? If using Anaconda, it installs everything in the base environment. Personally, I use Miniconda and install everything in virtual environments with a very minimal base environment. See stackoverflow.com/a/56504279 Also check out github.com/tensorflow/tensorflow/issues/22794 You may need to install the MSVC redistributable.iz_
I am using Anaconda so wondering why still getting this error when everything is installed in base environment. Any suggestions on correcting this issue while continuing with base Anaconda environment?user3205469

1 Answers

0
votes

I was able to resolve the issue and it seems it was primarily due to tensorflow version. Well here are the steps I followed to install witwidget on my Windows laptop with Anaconda Python (v3.7)

pip install pyhamcrest pip install google-auth conda update wrapt

Now is the important part. You need to uninstall tensorflow, if it is version > 2.0. So try running this command to install tensorflow v 2.0

pip install tensorflow==2.0.0

Then execute these commands and you are good to go

pip install witwidget jupyter nbextension install --py --symlink --sys-prefix witwidget jupyter nbextension enable --py --sys-prefix witwidget

Thanks !