简体   繁体   English

ModuleNotFoundError:即使在Windows PC中使用anaconda成功安装了opencv库之后,在Spyder IDE中也没有名为“ cv2”的模块

[英]ModuleNotFoundError: No module named 'cv2' in Spyder IDE, even after I have successfully installed opencv library using anaconda in my windows pc

I have successfully installed opencv and dlib in my windows pc following this site: https://www.learnopencv.com/install-opencv-3-and-dlib-on-windows-python-only/ I have checked the version of opencv and dlib in cmd which make me sure that these libraries are installed in my windows pc. 我已经在此站点之后的Windows PC中成功安装了opencv和dlib: https ://www.learnopencv.com/install-opencv-3-and-dlib-on-windows-python-only/我已经检查了opencv的版本和cmd中的dlib,这确保我在Windows pc中安装了这些库。 Version checking in CMD CMD中的版本检查

Now I open spyder which was installed by anaconda as default and I imported cv2 and dlib. 现在,我打开由anaconda默认安装的spyder,并导入了cv2和dlib。 But it gives error as no module named cv2 found, no module named dlib found. 但是由于没有找到名为cv2的模块,也没有找到名为dlib的模块,因此出现错误。

Which step am I missing here? 我在这里错过了哪一步? I am just a starter in programming world. 我只是编程界的入门者。 Thanks for your help in advance. 感谢您的帮助。

You must run Spyder in the same virtual env as you are running your Python instance, in the screenshot. 在屏幕快照中,您必须在与运行Python实例相同的虚拟环境中运行Spyder。

You can do that by first installing Spyder in the virtual env, like so, 您可以通过先在虚拟环境中安装Spyder来做到这一点,就像这样,

  1. activate opencv-env
  2. conda install spyder

and then calling the spyder executable from the same console. 然后从同一控制台调用spyder可执行文件。

That should do the trick. 这应该够了吧。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 即使使用pip成功安装了名为“ cv2”的模块,也没有 - No module named 'cv2' even after successfully installing it using pip OpenCV 安装成功但导入错误:没有名为“cv2”的模块 - OpenCV installed successfully BUT ImportError: No module named 'cv2' 即使安装成功,也没有名为“cv2”的模块 - No module named 'cv2' even though it was successfully installed 成功安装opencv3.4.0后出现“no module named cv2” - “no module named cv2” after installing opencv3.4.0 successfully ModuleNotFoundError:Python 中没有名为“cv2”的模块 - Windows - ModuleNotFoundError: No module named 'cv2' in Python - Windows 即使我安装了它,也没有名为“cv2”的模块 - No module named 'cv2' even though I installed it 已安装 opencv-python 但无法导入(ModuleNotFoundError: No module named 'cv2') - Installed opencv-python but cannot import (ModuleNotFoundError: No module named 'cv2') ModuleNotFoundError:没有名为“cv2”的模块 - ModuleNotFoundError: No module named 'cv2' ModuleNotFoundError:没有名为“cv2”的模块 - ModuleNotFoundError: No module named ‘cv2’ ModuleNotFoundError:尽管 Anaconda 导航器上安装了 ffmpeg,但 Spyder 上没有名为“ffmpeg”的模块 - ModuleNotFoundError: No module named 'ffmpeg' on Spyder although ffmpeg is installed on Anaconda navigator
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM