I recently learned about environments in conda, as it was necessary to take advantage of the osmnx library. But I can't get a jupyter notebook to use that environment.
I have followed the instructions/answers/hints from environmental_kernels, a similar stackoverflow questionand this person having the same error on conda_env_dirs. To no avail.
I'll outline my steps I've taken so far.
- Created and entered an environment using
source activate OSMNX
- Open python and confirm osmnx loads (
import osmnx
with no errors). - Install environment kernels (
pip install environment_kernels
) Edit ~/.jupyter/jupyter_notebook_config.py by adding the following two lines:
c.NotebookApp.kernel_spec_manager_class = 'environment_kernels.EnvironmentKernelSpecManager' c.EnvironmentKernelSpecManager.env_dirs=['~/.conda/envs']
- Install jupyter in environment (
conda install jupyter
) - Run
jupyter notebook
When it runs I see that I can start a new notebook, but only in Python 3.
When I open an existing notebook, I see the option to change kernels, but again only one option listed.
And most importantly, when I try to import osmnx, I get an error.
When I run which python
and which jupyter
I get two paths:
which python
: /Users/scottieb/anaconda/envs/OSMNX/bin/python
which jupyter
: /Users/scottieb/anaconda/envs/OSMNX/bin/jupyter
It feels like I must have missed a step with environment kernels, but the setup instructions are so simple that there's not much to have overlooked.