python安装cv2模块,已安装OpenCV,但未找到模块“ cv2”。在IDLE中

I have been trying to install OpenCV for ages now and finally I succeeded using this tutorial: http://www.pyimagesearch.com/2016/12/05/macos-install-opencv-3-and-python-3-5/.

However, whenever I try to import cv2 in IDLE, it is not found but I am certain I installed OpenCV.

The cv2.so file exists at:

/usr/local/lib/python3.5/site-packages/cv2.so

I believe it may have something to do with the interpreter but I am not sure how to fix it. In terminal, when I try importing it, it works. I included the terminal message to prove it.

xRQ12.png

Any help is appreciated. Thank you.

解决方案

ok i found the answer! after you activate the virtual environment with:

work on cv

type this on the terminal to open the IDLE with the current virtual environment

python -c "from idlelib.PyShell import main; main()"

or

python -m idlelib

and it will do the trick!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值