I am a complete beginner to opencv
. I wrote this code in spyder and it shows no module named 'cv2'
import cv2
img = cv2.imread('D:\ML\img1.jfif',1)
cv2.imshow('D:\ML\img1.jfif',img)
cv2.waitKey(0)
cv2.destroyAllWindows()
but the same code works in the python cmd
any help is appreciated. Thank you
Probably a diffent Python interpreter / executable for each case:
You can check:
import sys
print(sys.executable)
There are multiple reasons why this could be the case.
Plase provide which python interpreter you have set up for your Spyder, if this is the only installed python on your path and how you installed cv2.
Best regards and good luck!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.