Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
309 views
in Technique[技术] by (71.8m points)

python - Jupyter notebook can't load installed package in conda environment

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...