【问题标题】:Python Jupyter Anaconda, can't import cv or geopyPython Jupyter Anaconda,无法导入 cv 或 geopy
【发布时间】:2018-02-01 23:00:03
【问题描述】:

我已经能够在命令窗口中使用 pip install 安装这两个模块,没有任何问题(Windows 7 64)。当我尝试在 Jupyter 中导入时,我收到以下错误消息:

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-5-305887a710d6> in <module>()
----> 1 import cv

ModuleNotFoundError: No module named 'cv'

关于 Jupyter Notebook:

    Server Information:
You are using Jupyter notebook.

The version of the notebook server is 5.0.0 and is running on:
Python 3.6.3 |Anaconda, Inc.| (default, Oct 15 2017, 03:27:45) [MSC v.1900 64 bit (AMD64)]

Current Kernel Information:
Python 3.6.3 |Anaconda, Inc.| (default, Oct 15 2017, 03:27:45) [MSC v.1900 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 6.1.0 -- An enhanced Interactive Python. Type '?' for help.

我对 python/编程非常陌生,如果这还不是很明显的话。谢谢。

【问题讨论】:

  • 当你在命令行中执行python -c "import cv"时会发生什么?
  • 文件 "",第 1 行 python -c "import cv" ^ SyntaxError: invalid syntax
  • 不是来自 ipython 命令行。我的意思是windows命令行。运行 cmd.exe 时得到的那个
  • 你指的是命令提示符窗口(dos prompt)吗?
  • 是的,我就是这个意思

标签: python import anaconda jupyter


【解决方案1】:

做了一些搜索。包索引中没有包 cv。你需要pip install opencv-python,之后你可以做import cv2

基于 cmets 进行编辑:确保在运行 pip install 之前,在 PATH 中的任何其他 python 发行版之前设置 Anaconda

【讨论】:

  • Thx,返回:要求已经满足:......但回到 Jupyter 我得到相同的错误消息......没有名为“cv2”的模块
猜你喜欢
  • 1970-01-01
  • 2018-04-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-12-22
  • 2019-07-19
相关资源
最近更新 更多