我尝试安装SimpleCV
包:
C:\>easy_install C:\Python27\lib\site-packages\simplecv-1.2-py2.7.egg
Processing simplecv-1.2-py2.7.egg
simplecv 1.2 is already the active version in easy-install.pth
Installed c:\python27\lib\site-packages\simplecv-1.2-py2.7.egg
Processing dependencies for simplecv==1.2
Finished processing dependencies for simplecv==1.2
但是当我尝试导入它时,它不起作用:
import simplecv
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named simplecv
>>> from SimpleCV import Shell
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build\bdist.win32\egg\SimpleCV\__init__.py", line 3, in <module>
# $Id$
File "build\bdist.win32\egg\SimpleCV\base.py", line 29, in <module>
ImportError: No module named cv
为什么我不能导入它?
答案 0 :(得分:2)
您应该安装OpenCV。 OpenCV可能需要安装其他一些库,即PyGame
我不知道Windows是否有一些自动程序,在我的Ubuntu中我只发出了两个命令(除了easy_install的simplecv):
sudo apt-get install python-pygame
sudo apt-get install python-opencv
之后它有两种方式:
>>> import SimpleCV
>>> from SimpleCV import Shell
答案 1 :(得分:0)
你刚试过:
import SimpleCV
或
from SimpleCV import *
python区分大小写。