在pycharm中找不到opencv函数的参考 [英] cannot find reference for opencv functions in pycharm
问题描述
我已经安装了 opencv-python 并且在站点包和 DLL 中添加了 .pyd 文件.该代码适用于图像.当我想阅读、展示、编写图像时,它可以工作.但是我收到警告,在 init.py 中找不到函数的引用.因此,我无法使用自动完成功能.有人可以帮我吗?我在 pycharm 中使用 opencv 3.4.0 和 python 3.6.4.我在命令提示符下通过 pip 下载了 opencv.
I have opencv-python installed and the .pyd file is added in the site-packages and the DLLs. The code works with images. When I want to read, show, write an image it works. But I get a warning that the functions' references cannot be found in init.py . Due to this, I can not use the auto-complete feature. Could someone help me out? I am using opencv 3.4.0 and python 3.6.4 in pycharm. I downloaded opencv via pip in the command prompt.
推荐答案
问题是由 CV2 和 init.py 如何进行导入引起的.只需忽略应用程序将正常工作的警告.或者您可以使用
The problem is caused by CV2 and how init.py does the imports. Just ignore the warnings the app will work the same. Or you can do an import with alias like
import cv2.cv2 as cv2
如果您有警告,请按 Alt+Return 安装并修复它.现在,您将在项目中自动完成并且没有其他警告(关于此).
If you have a warning on it press Alt+Return to install and fix it. Now you will have the autocomplete and no other warnings (about that) on the project.
这篇关于在pycharm中找不到opencv函数的参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!