I'm trying to use ein to edit a jupyter notebook. I used conda to install the 'turicreate' package in a virtual environment and activated it. When I run the regular browser based jupyter notebook command everything works. Only inside ein does it not work -- I can open the notebook, but when I try to import turicreate it complains it can't find the module.
First I tried:
(setq ein:jupyter-default-server-command (format "%s/anaconda3/bin/jupyter" (getenv "HOME")))
This got ein to open the notebook, but the import failed. I figured the conda env wasn't propagating so I opened a shell, activated the environment and did:
$ env | grep -i py $ env | grep -i conda
To see if activating just set env vars. So then I tried:
(setenv "CONDA_DEFAULT_ENV" "virtual_environment_name") (setenv "CONDA_PREFIX" (format "%s/anaconda3/envs/virtual_environment_name" (getenv "HOME")))
I shutdown all jupyter servers and tried
ein:run again. Still no dice.
So then I wrote a shell script:
#!/bin/bash conda activate virtual_environment_name $HOME/anaconda3/bin/jupyter "$@"
(setq ein:jupyter-default-server-command (format "%s/jupyter-with-anaconda.sh" (getenv "HOME")))
And it STILL can't find the module. At this point I'm at a loss. I have no idea how the environment state gets to the browser based jupyter so I don't know how to duplicate it for ein.