Re:Estimating Number of Jupyter Notebooks on Github
by bawana on Wednesday May 08, 2019 @01:20PM
(#19860985)
I've noticed that if I dont install jupyter to each venv, then the pythonpath defaults to the jupyter install. As a result, the jupyter notebook cannot find the packages in the venv(for example, caffe, module not found errors)
[ Parent
| on HN ]
Re:Estimating Number of Jupyter Notebooks on Github
by claytonjy on Wednesday May 08, 2019 @02:21PM
(#19861510)
huh, I've never used Caffe but wrapping my venvs with pipenv has never caused me this kind of grief.
I tell pipenv to store venv stuff in the project folder (`export PIPENV_VENV_IN_PROJECT=1`), and then do the following to start a new project:
pipenv --python 3.7
pipenv install ipykernel
pipenv run python -m ipykernel install --user --name=`basename $(pipenv run dirname '$VIRTUAL_ENV')
jupyter lab
(all the magic is in that third command)Then in the list of kernels, in addition to the usual suspects I'll have one named for the folder I ran the above in. If I started a notebook before all that, I'll have to change it's kernel. Doing more `pipenv install` at the prompt makes new packages immediately available in the running notebook.