Python 使用Eclipse完成SimpleCV代码

Python 使用Eclipse完成SimpleCV代码,python,eclipse,simplecv,Python,Eclipse,Simplecv,在遇到一些问题后,我最近成功地启动并运行了SimpleCV。我现在安装了一个工作的SimpleCV,并将其与Eclipse Indigo一起使用。但是,我从SimpleCV导入的所有内容都用红色标记,Eclipse声明它找不到指定的导入内容(即使导入的函数工作正常) 有没有办法让Eclipse识别来自SimpleCV的导入,以便我可以使用它的Ctrl空格代码完整的功能 我试图将“SimpleCV”添加到强制内置项中,但没有成功。(这是我在OpenCV遇到同样问题时所做的,当时它工作正常) 谢谢你

在遇到一些问题后,我最近成功地启动并运行了SimpleCV。我现在安装了一个工作的SimpleCV,并将其与Eclipse Indigo一起使用。但是,我从SimpleCV导入的所有内容都用红色标记,Eclipse声明它找不到指定的导入内容(即使导入的函数工作正常)

有没有办法让Eclipse识别来自SimpleCV的导入,以便我可以使用它的Ctrl空格代码完整的功能

我试图将“SimpleCV”添加到强制内置项中,但没有成功。(这是我在OpenCV遇到同样问题时所做的,当时它工作正常)


谢谢你的建议

导入在SimpleCV中非常不稳定。我一直在与你的问题作斗争。他们不想修复它的原因(根据他们在网站()上的回答)并不是因为他们“都使用vim、emacs、vi”,而是因为他们的许多代码依赖于使用*imports将大量库拉入本地名称空间。这充其量是惰性编程,否则编程就非常糟糕

见鬼,你甚至不能自己导入他们的一些文件,因为他们依赖于已经导入的SimpleCVinit.py文件和base.py文件。这两个文件都有大量的全面导入。我想知道为什么导入SimpleCV需要2秒以上的时间才能在我的电脑上用SSD运行。现在我知道了

他们的init.py文件包含以下导入:

from SimpleCV.base import *
from SimpleCV.Camera import *
from SimpleCV.Color import *
from SimpleCV.Display import *
from SimpleCV.Features import *
from SimpleCV.ImageClass import *
from SimpleCV.Stream import *
from SimpleCV.Font import *
from SimpleCV.ColorModel import *
from SimpleCV.DrawingLayer import *
from SimpleCV.Segmentation import *
from SimpleCV.MachineLearning import *
import os
import sys
import warnings
import time
import socket
import re
import urllib2
import types
import SocketServer
import threading
import tempfile
import zipfile
import pickle
import glob #for directory scanning
import abc #abstract base class
import colorsys
import logging
import pygame as pg
import scipy.ndimage as ndimage
import scipy.stats.stats as sss  #for auto white balance
import scipy.cluster.vq as scv    
import scipy.linalg as nla  # for linear algebra / least squares
import math # math... who does that 
import copy # for deep copy
import numpy as np
import scipy.spatial.distance as spsd
import scipy.cluster.vq as cluster #for kmeans
import pygame as pg
import platform
import copy
import types
import time

from numpy import linspace
from scipy.interpolate import UnivariateSpline
from warnings import warn
from copy import copy
from math import *
from pkg_resources import load_entry_point
from SimpleHTTPServer import SimpleHTTPRequestHandler
from types import IntType, LongType, FloatType, InstanceType
from cStringIO import StringIO
from numpy import int32
from numpy import uint8
from EXIF import *
from pygame import gfxdraw
from pickle import *
并且他们的base.py文件还有更多的导入:

from SimpleCV.base import *
from SimpleCV.Camera import *
from SimpleCV.Color import *
from SimpleCV.Display import *
from SimpleCV.Features import *
from SimpleCV.ImageClass import *
from SimpleCV.Stream import *
from SimpleCV.Font import *
from SimpleCV.ColorModel import *
from SimpleCV.DrawingLayer import *
from SimpleCV.Segmentation import *
from SimpleCV.MachineLearning import *
import os
import sys
import warnings
import time
import socket
import re
import urllib2
import types
import SocketServer
import threading
import tempfile
import zipfile
import pickle
import glob #for directory scanning
import abc #abstract base class
import colorsys
import logging
import pygame as pg
import scipy.ndimage as ndimage
import scipy.stats.stats as sss  #for auto white balance
import scipy.cluster.vq as scv    
import scipy.linalg as nla  # for linear algebra / least squares
import math # math... who does that 
import copy # for deep copy
import numpy as np
import scipy.spatial.distance as spsd
import scipy.cluster.vq as cluster #for kmeans
import pygame as pg
import platform
import copy
import types
import time

from numpy import linspace
from scipy.interpolate import UnivariateSpline
from warnings import warn
from copy import copy
from math import *
from pkg_resources import load_entry_point
from SimpleHTTPServer import SimpleHTTPRequestHandler
from types import IntType, LongType, FloatType, InstanceType
from cStringIO import StringIO
from numpy import int32
from numpy import uint8
from EXIF import *
from pygame import gfxdraw
from pickle import *
你知道,他们声称要转换所有这些完全不同的CV库,并对它们应用“Pythonic”方法。但这种导入混乱恰恰证明了他们的错误

我试图修复它们的导入是从init.py文件中删除所有这些导入*,这有助于解决eclipse中出现的代码完成延迟问题。然后将SimpleCV egg目录(C:\Python27\Lib\site packages\SimpleCV-1.3-py2.7.egg)作为外部库导入eclipse。之后,我能够运行以下操作:

from SimpleCV.ImageClass import Image
导入颜色也一样:

from SimpleCV.Color import Color

有周期性的导入,所以要小心,因为它们可能会咬到你。我自己在导入SimpleCV.ImageClass之前尝试导入SimpleCV.Color时也有一个。注意,通过上面的说明,我似乎能够从Eclipse中完成代码。

导入在SimpleCV中非常困难。我一直在为同样的问题而挣扎他们不想解决这个问题的原因(根据他们网站()上的答案)不是因为他们“都使用vim、emacs、vi”,而是因为他们的很多代码依赖于使用*导入将大量库拉入本地名称空间。这最多是懒惰的编程,否则编程就很糟糕

见鬼,你甚至不能自己导入他们的一些文件,因为他们依赖于已经导入的SimpleCVinit.py文件和base.py文件。这两个文件都有大量的全面导入。我想知道为什么导入SimpleCV需要2秒以上的时间才能在我的电脑上用SSD运行。现在我知道了

他们的init.py文件包含以下导入:

from SimpleCV.base import *
from SimpleCV.Camera import *
from SimpleCV.Color import *
from SimpleCV.Display import *
from SimpleCV.Features import *
from SimpleCV.ImageClass import *
from SimpleCV.Stream import *
from SimpleCV.Font import *
from SimpleCV.ColorModel import *
from SimpleCV.DrawingLayer import *
from SimpleCV.Segmentation import *
from SimpleCV.MachineLearning import *
import os
import sys
import warnings
import time
import socket
import re
import urllib2
import types
import SocketServer
import threading
import tempfile
import zipfile
import pickle
import glob #for directory scanning
import abc #abstract base class
import colorsys
import logging
import pygame as pg
import scipy.ndimage as ndimage
import scipy.stats.stats as sss  #for auto white balance
import scipy.cluster.vq as scv    
import scipy.linalg as nla  # for linear algebra / least squares
import math # math... who does that 
import copy # for deep copy
import numpy as np
import scipy.spatial.distance as spsd
import scipy.cluster.vq as cluster #for kmeans
import pygame as pg
import platform
import copy
import types
import time

from numpy import linspace
from scipy.interpolate import UnivariateSpline
from warnings import warn
from copy import copy
from math import *
from pkg_resources import load_entry_point
from SimpleHTTPServer import SimpleHTTPRequestHandler
from types import IntType, LongType, FloatType, InstanceType
from cStringIO import StringIO
from numpy import int32
from numpy import uint8
from EXIF import *
from pygame import gfxdraw
from pickle import *
并且他们的base.py文件还有更多的导入:

from SimpleCV.base import *
from SimpleCV.Camera import *
from SimpleCV.Color import *
from SimpleCV.Display import *
from SimpleCV.Features import *
from SimpleCV.ImageClass import *
from SimpleCV.Stream import *
from SimpleCV.Font import *
from SimpleCV.ColorModel import *
from SimpleCV.DrawingLayer import *
from SimpleCV.Segmentation import *
from SimpleCV.MachineLearning import *
import os
import sys
import warnings
import time
import socket
import re
import urllib2
import types
import SocketServer
import threading
import tempfile
import zipfile
import pickle
import glob #for directory scanning
import abc #abstract base class
import colorsys
import logging
import pygame as pg
import scipy.ndimage as ndimage
import scipy.stats.stats as sss  #for auto white balance
import scipy.cluster.vq as scv    
import scipy.linalg as nla  # for linear algebra / least squares
import math # math... who does that 
import copy # for deep copy
import numpy as np
import scipy.spatial.distance as spsd
import scipy.cluster.vq as cluster #for kmeans
import pygame as pg
import platform
import copy
import types
import time

from numpy import linspace
from scipy.interpolate import UnivariateSpline
from warnings import warn
from copy import copy
from math import *
from pkg_resources import load_entry_point
from SimpleHTTPServer import SimpleHTTPRequestHandler
from types import IntType, LongType, FloatType, InstanceType
from cStringIO import StringIO
from numpy import int32
from numpy import uint8
from EXIF import *
from pygame import gfxdraw
from pickle import *
你知道,他们声称要转换所有这些完全不同的CV库,并对它们应用“Pythonic”方法。但这种导入混乱恰恰证明了他们的错误

我试图修复它们的导入是从init.py文件中删除所有这些导入*,这有助于解决eclipse中出现的代码完成延迟问题。然后将SimpleCV egg目录(C:\Python27\Lib\site packages\SimpleCV-1.3-py2.7.egg)作为外部库导入eclipse。之后,我能够运行以下操作:

from SimpleCV.ImageClass import Image
导入颜色也一样:

from SimpleCV.Color import Color

有周期性的导入,所以要小心,因为它们可能会咬到你。我自己在导入SimpleCV.ImageClass之前尝试导入SimpleCV.Color时也有一个。注意,按照上面的说明,我似乎能够从Eclipse获得代码完整性。

恐怕我的系统上不再有SimpleCV了,所以我无法检查它。之后r有一段时间我放弃了,但是,我切换到了OpenCV。一旦你通过了最初的学习曲线,就真的没有那么糟糕了。但是,让它工作起来做得很好!我只是没有耐心…我担心我的系统上不再有SimpleCV了,所以我无法检查它。然而,过了一段时间,我就放弃了,切换到了OpenCV。一旦你通过了最初的学习曲线,就真的没那么糟糕了。不过,在让它开始工作方面做得很好!我只是没有耐心。。。