How to place custom Jupyter kernels inside virtual environment?
<p>I have a custom Jupyter kernel which runs IPython using a custom IPython profile which uses a matplotlib stylesheet.</p>

<p>I know to run this successfully normally I would put: </p>

<ul>
<li><p>The matplotlib stylesheet in ~/.config/matplotlib/stylelib/</p></li>
<li><p>The IPython profile in ~/.ipython/ </p></li>
<li><p>The kernel json in ~/.jupyter/kernels/my_kernel/</p></li>
</ul>

<p>But I am doing this as part of larger program which runs in a virtualenv, and if I put the things as above then any notebook server running on the computer will be able to see the custom kernels, even if it is running outside the venv. I don't what this because I don't want my program to interfere with other notebooks on the computer.</p>

<p>I think what I need to do is put the things above somewhere equivalent inside the venv but I can't figure out where they should go. Doe anyone know where they would go? Or is this just a thing IPython/Jupiter can't/won't do?</p>

<p>It's probably worth mentioning that in the case of the stylesheet for example I don't want to just put it in the working directory of my program (which is one option matplotlib offers). </p>