title: Module Keras displayed as "no module name 'keras'" while installed in virtual environment
body: <p>I know there is plenty topics about this particular issue but none of them solved it. <br>
  I use a virtual environment called <code>deeplearning</code> in a Jupyterlab notebook.</p>
  
  <h1>the error itself</h1>
  
  <p>I have troubles to import <code>keras</code> or <code>tensorflow</code> while trying to import a model object <a href="https://stackoverflow.com/a/56641218/10314460">even with "solution" proposed here</a></p>
  
  <pre><code>from keras.models import Sequential
  #or
  from tensorflow.keras.models import Sequential 
  </code></pre>
  
  <p>Then it returns the following errors:</p>
  
  <pre><code>----&gt; 1 from tensorflow.keras.models import Sequential
  
  ModuleNotFoundError: No module named 'tensorflow'
  </code></pre>
  
  <h1>modules installed</h1>
  
  <p>In my <code>deeplearning</code> virtual environment the following modules are installed:</p>
  
  <pre><code>(base) user@machine:~$ conda activate deeplearning
  (deeplearning) user@machine:~$ conda list
  # packages in environment at /home/user/anaconda3/envs/deeplearning:
  +------------+---------+--------------------+
  |    Name    | Version |       Build        |
  +------------+---------+--------------------+
  | python     |   3.6.7 | h0371630_0         |
  | jupyterlab |  0.35.3 | py36_0             |
  | jupyter    |   1.0.0 | py36_7             |
  | tensorflow |   2.0.0 | mk1_py36hef7ec59_0 |
  | keras      |   2.3.1 | 0                  |
  +------------+---------+--------------------+
  </code></pre>
  
  <p>At first sight I thought the <code>Build</code> indicated as <code>0</code> was a problem but while <code>tensorflow</code> cannot be imported too... I do not know.</p>
  
  <h1>activation of environment and usage in notebook</h1>
  
  <p>I activated the <code>deeplearning</code> environment in a terminal, added it in the list of kernels using the following command <code>ipython kernel install --user --name=deeplearning</code>, then chose the kernel <code>deeplearning</code> available in the notebook.</p>
  
  <p>I don't know if this all normal but when I check in the list of the path I do not see the path of my virtual environment in it:</p>
  
  <pre><code>import sys
  print(sys.path)
  ['/home/user/anaconda3/lib/python37.zip',
   '/home/user/anaconda3/lib/python3.7', 
  '/home/user/anaconda3/lib/python3.7/lib-dynload', 
  '', 
  '/home/user/anaconda3/lib/python3.7/site-packages', 
  '/home/user/anaconda3/lib/python3.7/site-packages/IPython/extensions', 
  '/home/user/.ipython']
  </code></pre>
  
  <p>I wonder if this is the core of the problem and I have no idea what to do with all the attempts I already tried.</p>
  
  <h1>UPDATE about new attempts</h1>
  
  <p>I did launch the jupyterlab notebook in the virtual environment:</p>
  
  <pre><code>(base) user@machine:~$ conda activate deeplearning 
  (deeplearning) user@machine:~$ jupyter lab --no-browser.
  </code></pre>
  
  <p><em>for the ones who has troubles with the error <code>TypeError: __init__() got an unexpected keyword argument 'io_loop'</code> the solution proposed by <a href="https://stackoverflow.com/a/51749538/10314460">eroz</a> did work for me</em></p>
  
  <p><strong>But</strong> <code>keras</code> and <code>tensorflow</code> are still the troubling modules. While using the commands <code>!which python</code> it clearly indicates <code>/home/user/anaconda3/envs/deeplearning/bin/python</code> and <code>!conda list</code> displays the right set of modules, in the right kernel, with <code>keras</code> and <code>tensorflow</code> in it. Instead, other modules like <code>pickle</code> or <code>sklearn</code> work well.</p>
  
  <h1>UPDATE about what works.</h1>
  
  <p>In the terminal itself this is alright:</p>
  
  <pre><code>(deeplearning) user@machine:~$ python
  Python 3.6.7 |Anaconda, Inc.| (default, Oct 23 2018, 19:16:44) 
  [GCC 7.3.0] on linux
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; from tensorflow.keras.models import Sequential
  &gt;&gt;&gt; 
  #so no issue of module name
  </code></pre>
  
  <p>It seems the main problem is about the Anaconda/JupyterLab environment. But no idea how to solve it.</p>