Reputation: 67
After pasting CV2 Library in Spyder library folder, when it launching from Anaconda get this error
import cv2
ImportError: DLL load failed: The specified module could not be found.
import cv2 Traceback (most recent call last):
File "", line 1, in import cv2
ImportError: DLL load failed: The specified module could not be found.
Upvotes: 3
Views: 829
Reputation: 1315
If above solution doesn't work Open cmd promt and give following cmds.....
1) pip uninstall 2) pip install opencv-python (if you need only main modules ) or pip install opencv-contrib-python ( if you need both main and contrib modules ) 3) pip install opencv-python-headless ( if you need only main modules )or pip install opencv-contrib-python-headless( if you need both main and contrib modules )
....now import cv2
Upvotes: 1
Reputation: 1315
If the import fails on Windows, make sure you have Visual C++ redistributable 2015 installed. If you are using older Windows version than Windows 10 and latest system updates are not installed, Universal C Runtime might be also required.
Windows N and KN editions do not include Media Feature Pack which is required by OpenCV. If you are using Windows N or KN edition, please install also Windows Media Feature Pack.
If the above does not help, check if you are using Anaconda. Old Anaconda versions have a bug which causes the error, see https://github.com/skvark/opencv-python/issues/36 for a manual fix.
If you still encounter the error after you have checked all the previous solutions, download Dependencies and open the cv2.pyd (located usually at C:\Users\username\AppData\Local\Programs\Python\PythonXX\Lib\site-packages\cv2) file with it to debug missing DLL issues.
Upvotes: 0