本文介绍了自动完成对OpenCV的Python的Windows中不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法自动完成在Windows上的OpenCV(Python)的工作。

I cannot get autocomplete working for OpenCV (Python) on Windows.

据阿比德的说明这里 。自动完成的工作方式是阅读源的.py 文件,这些文件是纯文本。尝试安装从克里斯托夫Gohlke的库,这是经常更新,并为任何人谁做任何一种在Windows上的Python科学计算必须使用的资源。请确保您删除 cv2.pyd numpy的目录站点包第一。这些新的软件包将安装在崇高的文本自动完成引擎所需要的的.py 源文件。

The reason it's not working is because you're using a .pyd file, which is essentially the same as a compiled .dll. Autocomplete works by reading the source .py files, which are plain text. Try installing the OpenCV and Intel Math Kernel Library optimized NumPy packages from Christoph Gohlke's Python Extension Packages for Windows repository, which is frequently updated and a must-use resource for anyone who does any kind of scientific Python computing on Windows. Make sure you delete the cv2.pyd and numpy directories from site-packages first. These new packages will install the .py source files needed by the autocomplete engine in Sublime Text.

修改

EDIT

OK,所以我写了上面,因为它运作良好,对很多其他的包。我是一个Python 3的家伙,我从来没有从Gohlke安装OpenCV的,因为它只有Python 2里绑定。阅读@疯狂codeR的comment下面,我启动了Win7的,而事实上,他是绝对正确的(我真应该早点意识到这一点) - 自OpenCV的是用C / C ++,包括唯一的的.py 文件在Gohlke包 cv.py ,其全部内容如下:

OK, so I wrote the above because it worked well for a bunch of other packages. I'm a Python 3 guy, and I never installed OpenCV from Gohlke because it only has Python 2 bindings. After reading @CrazyCoder's comment below, I booted up Win7, and indeed he's absolutely correct (and I should have realized this before) - since OpenCV is written in C/C++, the only .py file included in the Gohlke package is cv.py, whose entire contents are as follows:

from cv2.cv import *

剩下的就是包含在 cv2.pyd 和一堆的.dll 秒。从完整的OpenCV的Windows分发是一个291 MB的下载,这将扩展为3 GB,少数的.py 文件有参与建设O​​penCV的,而且都没有任何好自动完成的目的。所以,不幸的是,我不知道是否有此刻你的问题的解决方案。只要保持得心应手,或许检查出的的,发表在2013年四月祝你好运!

The rest is contained in cv2.pyd and a bunch of .dlls. The full OpenCV Windows distribution from opencv.org is a 291 MB download, which expands to 3 GB, and the few .py files in there are involved in building OpenCV, and aren't any good for autocomplete purposes. So, unfortunately, I don't know if there's a solution to your problem at the moment. Just keep the docs handy, and perhaps check out OpenCV Computer Vision with Python from Packt/O'Reilly, published in April 2013. Good luck!

这篇关于自动完成对OpenCV的Python的Windows中不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 09:46
查看更多