Installed module not showing up in Jupyter

Hi I am trying to install a Python module and use it in Jupyter.
Following some other support posts, I used docker-compose exec zipline bash to install the module in the zipline container then I restarted the zipline container using docker-compose restart zipline, and checked that it was still installed, it was. The module does not show up in Jupyter, after restarting the kernel. I also tried restarting the Jupyter service but that did not work either.

What am I doing wrong?

Edit 1.0 I’ve noticed site-packages is in different locations from Jupyter to the terminal version when I exec into the zipline container.

  • Zipline Container: /opt/conda/lib/python3.6/site-packages/
  • Jupyter: /opt/conda/envs/zipline/lib/python3.6/site-packages/

Edit. 1.5 Based on what I know about Anaconda, the above shows that Jupyter is running Python through Anaconda installed with an environment called: zipline. However when I access the zipline container I do not see any Conda envs other than the base.

Edit 1.6 I found the Zipline env, it is not in the zipline container but in the Jupyter container.

I figured it out: go to the jupyter container, activate the zipline env and install stuff there for it to show up in Jupyter.

The general Jupyter IDE runs inside the jupyter container. So sometimes you can simply do a pip install PACKAGE in the /codeload/ path in the GUI terminal, restart a notebook, & it works. Sometimes you do need the full directions with some version of:

cd /path/to/quantrocket/folder
docker-compose exec zipline bash
pip install PACKAGE
exit
docker-compose restart zipline

I’ve found this to be the case if I’m doing research in a jupyter notebook (where I’ve installed the package using !pip install PACKAGE) but then move to a zipline backtest and get an error saying the package isn’t installed.