Re: [spyder] trouble importing openCV on OS X

748 views
Skip to first unread message

Carlos Córdoba

unread,
Sep 16, 2012, 7:34:21 PM9/16/12
to spyd...@googlegroups.com
Hi Daniel,

Probably the best way to do what you want is to change your python
interpreter instead of PYTHONPATH. To do it, you have to go to

Tools > Preferences > Console > Advanced Settings > Python executable

and use the button to the right to select the interpreter where you
installed OpenCV (which seems to be your system's python).

The reason is OpenCV is a shared library which surely is linked against
the python version where it is installed.

Cheers,
Carlos

El 16/09/12 13:28, Daniel escribió:
> Hi,
>
> first of all thanks for the new Mac OS X installer it works totally
> fine for me on 10.8 Mountain Lion.
>
> But i just can't manage to import the openCV module. I added the
> directory of the cv2.so file to the PYTHONPATH, but each time when i
> try " import cv2 " spyder crashes.
> If I use the system's built-in python2.7 distribution it works.
>
> Do you have any advise how to handle this problem?
>
> Thanks in advance,
> Daniel
> --
> You received this message because you are subscribed to the Google
> Groups "spyder" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/spyderlib/-/xvjBECbqiPgJ.
> To post to this group, send email to spyd...@googlegroups.com.
> To unsubscribe from this group, send email to
> spyderlib+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/spyderlib?hl=en.

Daniel

unread,
Sep 17, 2012, 10:47:58 AM9/17/12
to spyd...@googlegroups.com
Hi Carlos,

Thanks for your advise! 
Actually it worked only partly: I was able to import opencv via the console after changing it to my systems's python (v. 2.7.2) and it works fine to run scripts out of the editor. But if i use the console, to call a function, Spyder crashes as soon as I type a open bracket '(' . For example, the autocompletion works fine till 'cv.LoadImage' but as soon as I type '(' it crashes.

I don't know if it's my fault how I installed OpenCV, but I couldn't get it working all day long.  

But don't worry to much, since I have to start working on my project really soon, I will try another IDE in the meantime.

But thank you very much for your help,
Daniel

Thomas

unread,
Dec 30, 2013, 1:44:23 PM12/30/13
to spyd...@googlegroups.com
I can confirm this issue. But it seems related to any dll (.so in this case). 
Auto-completion works, but spyder crashes on the first open bracket '('. 
Strangely enough, it doesn't crash when one or more blank characters are written before '(', e.g. myModule.myMethod ( ... ).

Has anyone looked into this since the last post ?

Thanks,
Thomas
Reply all
Reply to author
Forward
0 new messages