title: tensorflow import error :cannot import name 'module_wrapper' from 'tensorflow.python.util'
body: <p>Code: import tensorflow</p>
  
  <p>Gives the following error</p>
  
  <p>ERROR:root:Internal Python error in the inspect module.
  Below is the traceback from this internal error.</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3296, in run_code
      exec(code_obj, self.user_global_ns, self.user_ns)
    File "&lt;ipython-input-2-d6579f534729&gt;", line 1, in &lt;module&gt;
      import tensorflow
    File "C:\Users\hp\AppData\Roaming\Python\Python37\site-packages\tensorflow\__init__.py", line 99, in &lt;module&gt;
      from tensorflow_core import *
    File "C:\Users\hp\AppData\Roaming\Python\Python37\site-packages\tensorflow_core\__init__.py", line 28, in &lt;module&gt;
      from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
    File "&lt;frozen importlib._bootstrap&gt;", line 1019, in _handle_fromlist
    File "C:\Users\hp\AppData\Roaming\Python\Python37\site-packages\tensorflow\__init__.py", line 50, in __getattr__
      module = self._load()
    File "C:\Users\hp\AppData\Roaming\Python\Python37\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:\Users\hp\AppData\Roaming\Python\Python37\site-packages\tensorflow_core\python\__init__.py", line 52, in &lt;module&gt;
      from tensorflow.core.framework.graph_pb2 import *
    File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\core\framework\graph_pb2.py", line 16, in &lt;module&gt;
      from tensorflow.core.framework import node_def_pb2 as tensorflow_dot_core_dot_framework_dot_node__def__pb2
    File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\core\framework\node_def_pb2.py", line 16, in &lt;module&gt;
      from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2
    File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\core\framework\attr_value_pb2.py", line 16, in &lt;module&gt;
      from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2
    File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\core\framework\tensor_pb2.py", line 16, in &lt;module&gt;
      from tensorflow.core.framework import resource_handle_pb2 as tensorflow_dot_core_dot_framework_dot_resource__handle__pb2
    File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\core\framework\resource_handle_pb2.py", line 92, in &lt;module&gt;
      __module__ = 'tensorflow.core.framework.resource_handle_pb2'
  TypeError: expected bytes, Descriptor found
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2033, in showtraceback
      stb = value._render_traceback_()
  AttributeError: 'TypeError' object has no attribute '_render_traceback_'
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\ultratb.py", line 1095, in get_records
      return _fixed_getinnerframes(etb, number_of_lines_of_context, tb_offset)
    File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\ultratb.py", line 313, in wrapped
      return f(*args, **kwargs)
    File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\ultratb.py", line 347, in _fixed_getinnerframes
      records = fix_frame_records_filenames(inspect.getinnerframes(etb, context))
    File "C:\ProgramData\Anaconda3\lib\inspect.py", line 1502, in getinnerframes
      frameinfo = (tb.tb_frame,) + getframeinfo(tb, context)
    File "C:\ProgramData\Anaconda3\lib\inspect.py", line 1460, in getframeinfo
      filename = getsourcefile(frame) or getfile(frame)
    File "C:\ProgramData\Anaconda3\lib\inspect.py", line 696, in getsourcefile
      if getattr(getmodule(object, filename), '__loader__', None) is not None:
    File "C:\ProgramData\Anaconda3\lib\inspect.py", line 733, in getmodule
      if ismodule(module) and hasattr(module, '__file__'):
    File "C:\Users\hp\AppData\Roaming\Python\Python37\site-packages\tensorflow\__init__.py", line 50, in __getattr__
      module = self._load()
    File "C:\Users\hp\AppData\Roaming\Python\Python37\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 "&lt;frozen importlib._bootstrap&gt;", line 1006, in _gcd_import
    File "&lt;frozen importlib._bootstrap&gt;", line 983, in _find_and_load
    File "&lt;frozen importlib._bootstrap&gt;", line 953, in _find_and_load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 219, in _call_with_frames_removed
    File "&lt;frozen importlib._bootstrap&gt;", line 1006, in _gcd_import
    File "&lt;frozen importlib._bootstrap&gt;", line 983, in _find_and_load
    File "&lt;frozen importlib._bootstrap&gt;", line 967, in _find_and_load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 677, in _load_unlocked
    File "&lt;frozen importlib._bootstrap_external&gt;", line 728, in exec_module
    File "&lt;frozen importlib._bootstrap&gt;", line 219, in _call_with_frames_removed
    File "C:\Users\hp\AppData\Roaming\Python\Python37\site-packages\tensorflow_core\__init__.py", line 32, in &lt;module&gt;
      from tensorflow._api.v1 import app
    File "C:\Users\hp\AppData\Roaming\Python\Python37\site-packages\tensorflow_core\_api\v1\app\__init__.py", line 14, in &lt;module&gt;
      from tensorflow.python.util import module_wrapper as _module_wrapper
  ImportError: cannot import name 'module_wrapper' from 'tensorflow.python.util' (C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\util\__init__.py)
  </code></pre>
  
  <p>I have installed tensorflow using the following command:</p>
  
  <blockquote>
    <p>pip install --ignore-installed --upgrade tensorflow-gpu==1.15.0</p>
  </blockquote>
  
  <p>Same issue occurs while importing keras too. Also note that I am new to tensorflow and keras </p>