swincas / cookies-n-code

A repo for code review sessions at CAS
http://astronomy.swin.edu.au/
MIT License
30 stars 34 forks source link

Getting jupyter notebooks to work with conda envs #31

Closed caitlinadams closed 6 years ago

caitlinadams commented 6 years ago

While trying to set up the tutorial this week, I thought I'd set up a conda environment with emcee and chainconsumer so that any user could easily run the notebook. Then I discovered that even when I run jupyter notebook from a conda environment, the notebook isn't actually using the environment. I checked this by running sys.executable which gave me:

'/Users/cadams/anaconda3/bin/python'

when it should have given me:

/Users/cadams/anaconda3/envs/chainconsumerenv/bin/python

I've tried various solutions as suggested in https://stackoverflow.com/questions/37085665/in-which-conda-environment-is-jupyter-executing but something almost always broke.

Does anyone have any experience solving this? Can we do this at cookies-n-code this week instead of a tutorial?

Caitlin

caitlinadams commented 6 years ago

I'm not getting this problem on my laptop now. In the new environment, I needed to install jupyter by running conda install jupyter when I started the new conda environment. Hopefully this works for others if anyone runs into this issue!