1

I have installed SimpleCV from the 1.3 Superpack in Win Server 2008 R2.

In Python, I can load the Image library as:

from SimpleCV import Image

This works correctly in Python scripts executed as

python script.py

It also works from IDLE and python interactive.

This ONLY works correctly if I am logged in as the user account used when installing SimpleCV.

I have set a system variable PYTHONPATH to value C:\SimpleCV1.3\files\opencv\build\python\2.7

If I log in with another account, "from SimpleCV import Image" executes correctly from IDLE in interactive mode. It also executes correctly if I launch python from a Windows Run "C:\Python27\python". If I just start a command shell and launch python interactve I get:

C:\Python27>python Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win 32 Type "help", "copyright", "credits" or "license" for more information.

from SimpleCV import Image

Traceback (most recent call last): File "", line 1, in File "C:\Python27\lib\site-packages\SimpleCV__init__.py", line 3, in

from SimpleCV.base import *   File "C:\Python27\lib\site-packages\SimpleCV\base.py", line 59, in <module>
raise ImportError("Cannot load OpenCV library which is required by SimpleCV" ) ImportError: Cannot load OpenCV library which is required by SimpleCV

Can anyone help me understand why this only works correctly in the original installation account, and works (partially) in other accounts? I'm particularly confused that it will execute correctly in IDLE interactive but not from a command line execution of the script.

Thank you!

user2103777
  • 11
  • 1
  • 1
  • 2
  • since different user(accounts) might have different environment settings, check, if PYTHONPATH (and other relevant vars) is set correctly for that account ? – berak Feb 24 '13 at 10:48
  • please install opencv 2.4 – bgth Nov 11 '17 at 14:01

2 Answers2

0

Can you verify that you have set both paths correctly?

SETX PATH C:/Python27/;C:/Python27/Scripts/;C:/OpenCV2.3/opencv/build/x86/vc10/bin/;%PATH%
SETX PYTHONPATH C:/OpenCV2.3/opencv/build/python/2.7/;%PYTHONPATH%

You may also want to try the following in a script and from the terminal:

import cv
print cv.__file__
import cv2
print cv2.__file__

and see if one works or the other doesn't.

xamox
  • 2,599
  • 4
  • 27
  • 30
0

enter code hereI used to isntall opencv in windows or linux from source if i had chose to build opencv WITH PYTHON (using CMAKE to configure and generate) when i was doing the installation (make install) if i previously had SimpleCV installed to my system then i had the message raise ImportError("Cannot load OpenCV library which is required by SimpleCV" ),but i could see that the library cv2.so existed at the path /usr/local/lib/python2.7/dist-packages after trying to find answers in several sites and spending lot of hours without success i tried to rename the CV2.SO TO CV2.PYD !!!!IT WORKED To do that i used the very simple commands in linux::

cd /usr/local/lib/python2.7/dist-packages

mv cv2.so cv2.pyd