Python Jupyer笔记本中未找到来自Conda env的包

Python Jupyer笔记本中未找到来自Conda env的包,python,jupyter-notebook,anaconda,ipython,Python,Jupyter Notebook,Anaconda,Ipython,我创建了一个名为imagescraper的环境,并用它安装了pip 然后,我继续使用pip安装一个名为ImageScraper的包 >>activate imagescraper [imagescraper]>>pip install ImageScraper 为了确保我成功安装了软件包,请执行以下操作: >>conda list [imagescraper] C:\Users\John>conda list # packages in enviro

我创建了一个名为imagescraper的环境,并用它安装了pip

然后,我继续使用pip安装一个名为ImageScraper的包

>>activate imagescraper
[imagescraper]>>pip install ImageScraper
为了确保我成功安装了软件包,请执行以下操作:

>>conda list

[imagescraper] C:\Users\John>conda list
# packages in environment at C:\Anaconda2\envs\imagescrap
#
future                    0.15.2                    <pip>
imagescraper              2.0.7                     <pip>
lxml                      3.6.0                     <pip>
numpy                     1.11.0                    <pip>
pandas                    0.18.0                    <pip>
pip                       8.1.1                    py27_1
python                    2.7.11                        4
python-dateutil           2.5.2                     <pip>
pytz                      2016.3                    <pip>
requests                  2.9.1                     <pip>
setproctitle              1.1.9                     <pip>
setuptools                20.3                     py27_0
simplepool                0.1                       <pip>
six                       1.10.0                    <pip>
vs2008_runtime            9.00.30729.1                  0
wheel                     0.29.0                   py27_0
看起来还可以,所以我继续使用

[imagescraper]>>jupyter notebook
在笔记本里,我写了一本新书,当我尝试同样的东西时

import image_scraper
我得到的回报是:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-6c2b65c9cdeb> in <module>()
----> 1 import image_scraper

ImportError: No module named image_scraper
这告诉我,它不是指我安装模块的环境


有什么方法可以确保我的笔记本电脑都参考自己的env软件包吗?

以下是两种可能的解决方案:

您可以根据
imagescraper
环境注册新内核。内核将从
imagescraper
环境启动,从而查看其所有包

source activate imagescraper
conda install ipykernel
ipython kernel install --name imagescraper
这将向jupyter仪表板添加一个名为
imagescraper
的新内核


另一种解决方案是将jupyter笔记本安装到
imagescraper
环境中,并从该环境启动jupyter。这需要在启动jupyter笔记本时激活
imagescraper

source activate imagescraper
conda install notebook
jupyter notebook

是的,您可以:在
imagescraper
环境中安装ipykernel。您可以在此处使用我的答案作为模板:。或者:在您的
imagestrapper
环境中安装jupyter,然后从此环境启动jupyter。谢谢您的帮助@cel你应该把它扩展成一个答案:-)谢谢!不知何故,我更喜欢在所有单独的环境中安装jupyter。工作起来很有魅力。
source activate imagescraper
conda install ipykernel
ipython kernel install --name imagescraper
source activate imagescraper
conda install notebook
jupyter notebook