title: How to use Jupyter notebooks in a conda environment?
body: <p>Typically one runs <code>jupyter notebook</code> or <code>jupyter-notebook</code> or <code>ipython notebook</code> in a terminal to
  start a Jupyter notebook webserver locally (and open the URL in the browser). When using <a href="https://docs.conda.io/" rel="noreferrer">conda</a>
  and <a href="https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html" rel="noreferrer">conda environments</a>, <strong>what is the best way to run a Jupyter notebook which allows to
  import Python modules installed in the conda environment?</strong></p>
  
  <p>As it seems, <a href="https://github.com/jupyter/jupyter/issues/245" rel="noreferrer">this</a> <a href="https://github.com/jupyter/notebook/issues/1524" rel="noreferrer">is</a> <a href="https://github.com/jupyter/notebook/issues/2359" rel="noreferrer">not</a> <a href="https://stackoverflow.com/questions/53440940/jupyter-notebooks-terminal-command-not-using-correct-conda-environment">quite</a> <a href="https://github.com/jupyter/notebook/issues/2898" rel="noreferrer">straight</a> <a href="https://stackoverflow.com/questions/43437884/jupyter-notebook-import-error-no-module-named-matplotlib">forward</a> <a href="https://stackoverflow.com/questions/35834746/my-jupyter-notebook-fails-to-import-anaconda-modules-consistently?rq=1">and</a> <a href="https://stackoverflow.com/questions/48858829/conda-environment-packages-not-coming-to-jupyter-notebook">many</a>
  <a href="https://github.com/jupyter/notebook/issues/397" rel="noreferrer">users</a> <a href="https://stackoverflow.com/questions/47557385/jupyter-notebook-cant-load-installed-package-in-conda-environment">have</a> <a href="https://stackoverflow.com/questions/37433363/link-conda-environment-with-jupyter-notebook">similar</a> <a href="https://github.com/jupyter/notebook/issues/3311" rel="noreferrer">troubles</a>.</p>
  
  <p>Most common error message seems to be: after installing a package XYZ in a conda environment
  <code>my-env</code> one can run <code>import XYZ</code> in a python console started in <code>my-env</code>, but running the same
  code in the <strong>Jupyter notebook will lead to an ImportError</strong>.</p>
  
  <p>This question has been asked many times, but there is no good place to answer it, most Q&amp;A's and
  Github tickets are quite messy so <a href="https://xkcd.com/927/" rel="noreferrer">let's start a new Q&amp;A here</a>.</p>