conda environment packages not coming to jupyter notebook

蓝咒 提交于 2020-01-05 07:46:24

问题


Packages imported in my conda environment are not available in Jupyter notebook started from that location.

I'm not sure if my steps are right, or am I missing anything

  1. Creaed a folder structure for my work, and cd into my folder
  2. I created conda environment with the list of packages I want conda create -n practice1env scipy opencv
  3. Activated the environment source activate practice1env
  4. Cloned my GitHub repo git clone https://xxx Note that this contains jupyter notebooks
  5. opened a notebook file from my clone, and trying to edit it

When I work with numpy functions, it doesn't give me any trouble. But when i'm trying to import cv2 it says

ModuleNotFoundError: No Module named 'cv2'

One thing to note here is that - when i executed some commands, I got to know that the conda environments are in folder /anaconda/envs/practice1env where as my working directory (where i cloned my git repo) is a different folder. Assuming this might be the issue, i even cloned my repo in the same anaconda env folder, but still, the issue remains the same.

Whereas when i type command import cv2 in the terminal where i created conda env, it is importing fine. But not in the notebook started from a folder either within it or a diff folder

来源:https://stackoverflow.com/questions/48858829/conda-environment-packages-not-coming-to-jupyter-notebook

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!