I am trying to import cv2 module in Spyder.app but somehow it does not import. By the way I am able to import it in a terminal. Can anyone of you guys please help me?
2 Answers
4
votes
This is what you need to do:
Open a terminal and run
pythonoripython.In there execute these two commands:
import syssys.executableCopy the output of the last command
Open Spyder and go to
Spyder > Preferences > Console > Advanced settings > Python ExecutableSelect the option
Use the following Python interpreterand paste there the result of step 3 (this option is only available in Spyder 2.2.3 or newer).
Finally go to
Interpreters > Open a Python interpreter. This will open a new console that will be running the same Python version that you use in a terminal.
import sys; print sys.pathin the context where it works and the context where it doesn't work. - zwolimport your_module; print your_module.__file__. - Jon