1

I've created a conda environment:

$ conda create --name py3 matplotlib scipy astropy photutils

Everything installed properly, including the photutils package that is installed from the http://ssb.stsci.edu/astroconda channel.

Now I activate the environment and open a Jupyter notebook:

$ source activate py3
(py3) $ jupyter notebook

With py3 as the Default environments, and photutils installed

enter image description here

I open a new notebook that uses the Default kernel and attempt to load photutils

enter image description here

which will not work.

What is going on here? The only thing that I find strange is that the name of the photutils package is shown as http://ssb.stsci.edu/astroconda::photutils0.4 by Jupyter in the Conda tab. Is this the issue? If so, how can I fix this?

Gabriel
  • 40,504
  • 73
  • 230
  • 404
  • I think the `default` kernel is installed in the environment where the Jupyter Notebook is installed. You either need to 1) install the notebook in the `py3` environment, or 2) install the `ipykernel` package in the `py3` notebook and launch the notebook from the root environment, then start a notebook with the `py3` kernel – darthbith Nov 29 '17 at 16:49
  • I don't follow. Jupyter is being loaded from the `py3` environment, so it is installed in it. – Gabriel Nov 29 '17 at 17:01
  • 1
    Not necessarily. If you didn't install the Notebook in the `py3` environment, your shell may still be finding the executable from the root environment, since that environment will still be on your PATH. What is the output of `which jupyter`? – darthbith Nov 29 '17 at 21:13
  • You are correct. It was picking up `jupyter` from `/home/gabriel/anaconda3/bin/` instead of the loaded environment. After `conda install jupyter` in the `py3` env (and restarting the terminal session) it now correctly points to `/home/gabriel/anaconda3/envs/py3/bin/` and the package is properly loaded. Could you turn your comment into an answer so I can accept it? – Gabriel Nov 29 '17 at 22:09

1 Answers1

1

The default kernel is installed in the environment where the Jupyter Notebook is installed. You either need to either 1) install the notebook pacakge in the py3 environment, or 2) install the ipykernel package in the py3 environment and launch the Notebook server from the root environment, then start a new Notebook with the (now newly added) py3 kernel.

darthbith
  • 18,484
  • 9
  • 60
  • 76