“DLL load failed” when import cv2 (opencv)
I spent many hours to solve this problem but I can't find a solution, please any clue that you know to share with me.
in [windows server 2012 R2 x64, python 3.7 64x]
pip install opencv-contrib-python
installed without any error .
and when I try to import it
import cv2
show me this error :
Traceback (most recent call last):
File "test.py", line 1, in <module>
import cv2
File "C:Program FilesPython37libsite-packagescv2__init__.py", line 3, in
<module>
from .cv2 import *
ImportError: DLL load failed: The specified module could not be found.
and I see another topic about this error but their solution does not work for me :
- DLL load failed error when importing cv2
- Failure to import cv2 in python : DLL load failed
- and a lot of pages in here
some of them say about that problem because anaconda, and I don't have anaconda even. and many say that problem 32 or 64 version, I try both and disappointment. many about system variables...
what dll
failed to load? cv2? why?
what i try till now:
- change python version : 3.5, 3.7, 2.7 in 86x and 64x (uninstall complete last version and delete all remain files in program files ... then install new one)
- try with another packages like : opencv-python, opencv-contrib, try install specific versions with .whl (in some topic i read about this so install numpy-1.14.5+mkl-cp37-cp37m-win_amd64.whl and opencv_python-3.4.3+contrib-cp37-cp37m-win_amd64.whl but anything not change)
- import numpy before cv2 for every test
- installed Microsoft Visual C++ 2015 Redistributable Update 3 , 2008 , 2010 , 2017 for 64x
please help me.
UPDATE
NEXT 2 DAY
I try to manage missing dll
base on dependency walker that mention in bellow post, download all dll
and put them in system 32, its a good clue but not solve the problem.
DAY 4,5
my next step , trying compile OpenCV in my machine , install visual studio 2012 + cmake and base on document compile 2 version , 64x and 32 , compiling have a lot of problem itself (like missing some lib from c lang and need to install Visual C++ Redistributable for Visual Studio 2012 ...) and I resolve all of them ,then I have 2 success compiled version but both have the same problem with missing dll
, the compile process is so slow and give 2 day from me. so if fail on this mission :/ I search for a new way...
DAY 6
my next step is to try to run OpenCV in my machine with docker ( I try but docker windows just install on windows 10 and windows server 2016) so I search for an alternative. I found Vagrant that work like docker but with VM (visual box) today my time spend for this articles, it's amazing, the concept of docker and vagrant is so Attractive, and I play with this like that I have new puzzle :)
first error show on ... and limitless errors go on :/
Day 7
Vagrant tests failed too because my windows server 2012 is a vb machine (visual server) and run a visual box in another visual box impossible!
so I need new clues :(
Day 8-9
try install vagrant with VMware , I download VMware, unfortunately this plugin is not free (79$) so I try to work with pythonanywhere.com that 'gives you access to machines with a full Python environment already installed.' in this free account, you can't openurl with urllib , and more limit...
so I wanna try to install ubuntu in VMware my self... I read here results after work. it's Impossible with same reason vb (visual box)
python opencv image-processing cv2
add a comment |
I spent many hours to solve this problem but I can't find a solution, please any clue that you know to share with me.
in [windows server 2012 R2 x64, python 3.7 64x]
pip install opencv-contrib-python
installed without any error .
and when I try to import it
import cv2
show me this error :
Traceback (most recent call last):
File "test.py", line 1, in <module>
import cv2
File "C:Program FilesPython37libsite-packagescv2__init__.py", line 3, in
<module>
from .cv2 import *
ImportError: DLL load failed: The specified module could not be found.
and I see another topic about this error but their solution does not work for me :
- DLL load failed error when importing cv2
- Failure to import cv2 in python : DLL load failed
- and a lot of pages in here
some of them say about that problem because anaconda, and I don't have anaconda even. and many say that problem 32 or 64 version, I try both and disappointment. many about system variables...
what dll
failed to load? cv2? why?
what i try till now:
- change python version : 3.5, 3.7, 2.7 in 86x and 64x (uninstall complete last version and delete all remain files in program files ... then install new one)
- try with another packages like : opencv-python, opencv-contrib, try install specific versions with .whl (in some topic i read about this so install numpy-1.14.5+mkl-cp37-cp37m-win_amd64.whl and opencv_python-3.4.3+contrib-cp37-cp37m-win_amd64.whl but anything not change)
- import numpy before cv2 for every test
- installed Microsoft Visual C++ 2015 Redistributable Update 3 , 2008 , 2010 , 2017 for 64x
please help me.
UPDATE
NEXT 2 DAY
I try to manage missing dll
base on dependency walker that mention in bellow post, download all dll
and put them in system 32, its a good clue but not solve the problem.
DAY 4,5
my next step , trying compile OpenCV in my machine , install visual studio 2012 + cmake and base on document compile 2 version , 64x and 32 , compiling have a lot of problem itself (like missing some lib from c lang and need to install Visual C++ Redistributable for Visual Studio 2012 ...) and I resolve all of them ,then I have 2 success compiled version but both have the same problem with missing dll
, the compile process is so slow and give 2 day from me. so if fail on this mission :/ I search for a new way...
DAY 6
my next step is to try to run OpenCV in my machine with docker ( I try but docker windows just install on windows 10 and windows server 2016) so I search for an alternative. I found Vagrant that work like docker but with VM (visual box) today my time spend for this articles, it's amazing, the concept of docker and vagrant is so Attractive, and I play with this like that I have new puzzle :)
first error show on ... and limitless errors go on :/
Day 7
Vagrant tests failed too because my windows server 2012 is a vb machine (visual server) and run a visual box in another visual box impossible!
so I need new clues :(
Day 8-9
try install vagrant with VMware , I download VMware, unfortunately this plugin is not free (79$) so I try to work with pythonanywhere.com that 'gives you access to machines with a full Python environment already installed.' in this free account, you can't openurl with urllib , and more limit...
so I wanna try to install ubuntu in VMware my self... I read here results after work. it's Impossible with same reason vb (visual box)
python opencv image-processing cv2
See this question
– Alistair Carscadden
Sep 17 '18 at 3:53
Can you try to add the .dll file to the same folder as the .pyd file? Maybe the remote server isn't checking in system32.dll?
– Daren Thomas
Sep 19 '18 at 12:29
add a comment |
I spent many hours to solve this problem but I can't find a solution, please any clue that you know to share with me.
in [windows server 2012 R2 x64, python 3.7 64x]
pip install opencv-contrib-python
installed without any error .
and when I try to import it
import cv2
show me this error :
Traceback (most recent call last):
File "test.py", line 1, in <module>
import cv2
File "C:Program FilesPython37libsite-packagescv2__init__.py", line 3, in
<module>
from .cv2 import *
ImportError: DLL load failed: The specified module could not be found.
and I see another topic about this error but their solution does not work for me :
- DLL load failed error when importing cv2
- Failure to import cv2 in python : DLL load failed
- and a lot of pages in here
some of them say about that problem because anaconda, and I don't have anaconda even. and many say that problem 32 or 64 version, I try both and disappointment. many about system variables...
what dll
failed to load? cv2? why?
what i try till now:
- change python version : 3.5, 3.7, 2.7 in 86x and 64x (uninstall complete last version and delete all remain files in program files ... then install new one)
- try with another packages like : opencv-python, opencv-contrib, try install specific versions with .whl (in some topic i read about this so install numpy-1.14.5+mkl-cp37-cp37m-win_amd64.whl and opencv_python-3.4.3+contrib-cp37-cp37m-win_amd64.whl but anything not change)
- import numpy before cv2 for every test
- installed Microsoft Visual C++ 2015 Redistributable Update 3 , 2008 , 2010 , 2017 for 64x
please help me.
UPDATE
NEXT 2 DAY
I try to manage missing dll
base on dependency walker that mention in bellow post, download all dll
and put them in system 32, its a good clue but not solve the problem.
DAY 4,5
my next step , trying compile OpenCV in my machine , install visual studio 2012 + cmake and base on document compile 2 version , 64x and 32 , compiling have a lot of problem itself (like missing some lib from c lang and need to install Visual C++ Redistributable for Visual Studio 2012 ...) and I resolve all of them ,then I have 2 success compiled version but both have the same problem with missing dll
, the compile process is so slow and give 2 day from me. so if fail on this mission :/ I search for a new way...
DAY 6
my next step is to try to run OpenCV in my machine with docker ( I try but docker windows just install on windows 10 and windows server 2016) so I search for an alternative. I found Vagrant that work like docker but with VM (visual box) today my time spend for this articles, it's amazing, the concept of docker and vagrant is so Attractive, and I play with this like that I have new puzzle :)
first error show on ... and limitless errors go on :/
Day 7
Vagrant tests failed too because my windows server 2012 is a vb machine (visual server) and run a visual box in another visual box impossible!
so I need new clues :(
Day 8-9
try install vagrant with VMware , I download VMware, unfortunately this plugin is not free (79$) so I try to work with pythonanywhere.com that 'gives you access to machines with a full Python environment already installed.' in this free account, you can't openurl with urllib , and more limit...
so I wanna try to install ubuntu in VMware my self... I read here results after work. it's Impossible with same reason vb (visual box)
python opencv image-processing cv2
I spent many hours to solve this problem but I can't find a solution, please any clue that you know to share with me.
in [windows server 2012 R2 x64, python 3.7 64x]
pip install opencv-contrib-python
installed without any error .
and when I try to import it
import cv2
show me this error :
Traceback (most recent call last):
File "test.py", line 1, in <module>
import cv2
File "C:Program FilesPython37libsite-packagescv2__init__.py", line 3, in
<module>
from .cv2 import *
ImportError: DLL load failed: The specified module could not be found.
and I see another topic about this error but their solution does not work for me :
- DLL load failed error when importing cv2
- Failure to import cv2 in python : DLL load failed
- and a lot of pages in here
some of them say about that problem because anaconda, and I don't have anaconda even. and many say that problem 32 or 64 version, I try both and disappointment. many about system variables...
what dll
failed to load? cv2? why?
what i try till now:
- change python version : 3.5, 3.7, 2.7 in 86x and 64x (uninstall complete last version and delete all remain files in program files ... then install new one)
- try with another packages like : opencv-python, opencv-contrib, try install specific versions with .whl (in some topic i read about this so install numpy-1.14.5+mkl-cp37-cp37m-win_amd64.whl and opencv_python-3.4.3+contrib-cp37-cp37m-win_amd64.whl but anything not change)
- import numpy before cv2 for every test
- installed Microsoft Visual C++ 2015 Redistributable Update 3 , 2008 , 2010 , 2017 for 64x
please help me.
UPDATE
NEXT 2 DAY
I try to manage missing dll
base on dependency walker that mention in bellow post, download all dll
and put them in system 32, its a good clue but not solve the problem.
DAY 4,5
my next step , trying compile OpenCV in my machine , install visual studio 2012 + cmake and base on document compile 2 version , 64x and 32 , compiling have a lot of problem itself (like missing some lib from c lang and need to install Visual C++ Redistributable for Visual Studio 2012 ...) and I resolve all of them ,then I have 2 success compiled version but both have the same problem with missing dll
, the compile process is so slow and give 2 day from me. so if fail on this mission :/ I search for a new way...
DAY 6
my next step is to try to run OpenCV in my machine with docker ( I try but docker windows just install on windows 10 and windows server 2016) so I search for an alternative. I found Vagrant that work like docker but with VM (visual box) today my time spend for this articles, it's amazing, the concept of docker and vagrant is so Attractive, and I play with this like that I have new puzzle :)
first error show on ... and limitless errors go on :/
Day 7
Vagrant tests failed too because my windows server 2012 is a vb machine (visual server) and run a visual box in another visual box impossible!
so I need new clues :(
Day 8-9
try install vagrant with VMware , I download VMware, unfortunately this plugin is not free (79$) so I try to work with pythonanywhere.com that 'gives you access to machines with a full Python environment already installed.' in this free account, you can't openurl with urllib , and more limit...
so I wanna try to install ubuntu in VMware my self... I read here results after work. it's Impossible with same reason vb (visual box)
python opencv image-processing cv2
python opencv image-processing cv2
edited Sep 25 '18 at 9:23
NIMISHAN
94811223
94811223
asked Sep 15 '18 at 23:20
Neo AndersonNeo Anderson
9917
9917
See this question
– Alistair Carscadden
Sep 17 '18 at 3:53
Can you try to add the .dll file to the same folder as the .pyd file? Maybe the remote server isn't checking in system32.dll?
– Daren Thomas
Sep 19 '18 at 12:29
add a comment |
See this question
– Alistair Carscadden
Sep 17 '18 at 3:53
Can you try to add the .dll file to the same folder as the .pyd file? Maybe the remote server isn't checking in system32.dll?
– Daren Thomas
Sep 19 '18 at 12:29
See this question
– Alistair Carscadden
Sep 17 '18 at 3:53
See this question
– Alistair Carscadden
Sep 17 '18 at 3:53
Can you try to add the .dll file to the same folder as the .pyd file? Maybe the remote server isn't checking in system32.dll?
– Daren Thomas
Sep 19 '18 at 12:29
Can you try to add the .dll file to the same folder as the .pyd file? Maybe the remote server isn't checking in system32.dll?
– Daren Thomas
Sep 19 '18 at 12:29
add a comment |
8 Answers
8
active
oldest
votes
This can happen if you are using windows 10 N distribution, the N distributions does not come pre installed with windows media feature pack, which is required after OpenCV version 3.4 and onwards.
The preferred solution is to install the feature pack at : https://www.microsoft.com/en-us/software-download/mediafeaturepack
Be careful to choose the version that works with your current version of windows.
If that is not an option, fall back to an earlier version of OpenCV that does not have dll dependencies, you can do that by:pip install opencv-python=3.3.0.9
Since windows rolled out it's N version this problem has been seen at many places, and has many impacts across the windows environment, the fastest way to identify if you have this problem is open youtube in Edge browser, if it says HTML5 media plugin not found, this is the problem.
Using pip to install opencv-python==3.3.0.9 worked for me, thanks! I'm using Anaconda 3, python 3.5.6 on a Windows 10 machine.
– CSharp
Jan 28 at 14:44
Thanks a lot! After countless hours of searching, this was the good answer. On Windows 10 N, you need to install the media feature pack. Thanks a lot!
– Phil
Feb 28 at 19:51
add a comment |
I had the same error (although I compiled OpenCV myself), in my case there were some DLL dependencies missing. You can check that with the program Dependency Walker.
Download Dependency Walker and run it, and open the file cv2.pyd with Dependency Walker, it should be in C:Program FilesPython37libsite-packagescv2
if the pip package installed correctly.
This program then scans for dependencies (which may take a few minutes) and it then shows missing DLL files in red.
1
thanks for your reply,your answer made me hopeful, i wake up at 4 AM for testing your advice, i download dependency walker and download all warning(yellow ones) dll's (not Ext.MS.* and Api.MS.*) and put them in system32 , but still not work. i can't figure out whats wrong, i run opencv in 2 local system today and it work perfectly but in my remote server is not ok.
– Neo Anderson
Sep 16 '18 at 6:51
add a comment |
Can you try uninstalling opencv and installing it using a wheel file instead? Here is a website that has many versions of OpenCV compiled for windows, search for the one you need and simply install it with pip
command.
So if you have Python 3.6 (64 Bit) and wish to install OpenCV 3.4.3 then download the wheel file:opencv_python‑3.4.3‑cp36‑cp36m‑win_amd64.whl
1
i test almost 10 of them ! but missing dll is appers on all of them.
– Neo Anderson
Sep 17 '18 at 17:11
add a comment |
Python 3.7 may not support some modules.
- Try installing python 3.6.4
- Using command prompt, "pip install
opencv" or "pip install opencv-python" - Import cv2
1
Thanks man! I had the same problem and downgrading to 3.6.4 worked for me. But when do you think they will fix this by?
– ѕняєє ѕιиgнι
Sep 22 '18 at 11:37
add a comment |
I have faced the similar issue in Windows Server 2012 r2. After lot of findings I found that mfplat.dll was missing which is related to Window Media Service.
Hence you have to manually install the features so that you can get dll related to window media service.
- Turn windows features on or off
- Skip the roles screen and directly go to Feature screen
- Select "Desktop Experience" under "User Interfaces and Infrastructure"
After this all required dll of opencv would be available.
add a comment |
i was suffering from the same problem "DLL load failed" after reading tons of answers and articles i got a solution.
i don't know this works for you or not but give it a try.
tools and versions i used: anaconda - 5.3.1, python - 3.7, win 10 (64 bit)
Steps i performed :
step1:i installed opencv 3.4.4 from here
then extract into C drive (you can do wherever you want)
step2: copy cv2.pyd file from [C:opencvbuildpythoncv2python-3.7] here to [C:Users"user-name"Anaconda3Libsite-packages] here.
step3: run dependency walker to detect which dll files are missing,
after running dependency walker in my case it showed two dll files are not loading, they are (1)OPENCV_WORLD344.DLL and (2)IESHIMS.DLL.
i don't know about your situation but you can do this-> find files name using dependency walker then find their path and follow step4.
step4: open System property->Advanced->Environment variables, now edit path and add C:opencvbuildx64vc14bin (in my case this was the place where OPENCV_WORLD344.DLL is stored) and after doing this, import cv2 in python.
If my answer does not work then add a comment.
add a comment |
After 15 days of brain storming, This solution worked for me. And I am sure that it will work for you too. I installed anaconda to use OpenCV 3.1.0. I followed following Steps:
1) I have installed anaconda-5.3 64-bit installer (614.3 MB) which uses python 3.7. You can download anaconda from link: https://www.anaconda.com/download/#windows
2) After installation of anaconda, open anaconda prompt by typing "anaconda prompt" on windows start button. Open with "Run as administrator".
3) You have to create new environment to install and use OpenCV module.Write following commands to create and activate new environment:>conda create --name myNewEnv python=3.5.0
>activate myNewEnv
"myNewEnv" is the name of new enviroment.
4)Now you need to install prerequisite for OpenCV, which is numpy and then install opencv3. Start internet before executing following commands:>conda install numpy
>conda install anaconda-client
>conda install --channel https://conda.anaconda.org/menpo opencv3
5)OpenCV3 has been installed. Now, verify installation by executing following commands:(myNewEnv) C:UsersNilesh> python
>>>import cv2
>>>cv2.__version__
Follow steps given below, when you want to start OpenCV3 second time onwards:
1) Open "anaconda command promt" from start menu with "run as administrator" rights
2) Type command >activate your_new_environment_name
3) Assume that you want to run file located on desktop, for that write following command:> cd C:UsersNileshDesktop
4) Now your working directory is Desktop.
5) Type following command to run any code (for example test.py).> python test.py
Note: Here, python means version-3.
I hope this solution will work for you.
add a comment |
I had similar issue except that I'm using Anaconda3 and this code here solved it:
conda install -c anaconda py-OpenCV
add a comment |
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52349669%2fdll-load-failed-when-import-cv2-opencv%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
8 Answers
8
active
oldest
votes
8 Answers
8
active
oldest
votes
active
oldest
votes
active
oldest
votes
This can happen if you are using windows 10 N distribution, the N distributions does not come pre installed with windows media feature pack, which is required after OpenCV version 3.4 and onwards.
The preferred solution is to install the feature pack at : https://www.microsoft.com/en-us/software-download/mediafeaturepack
Be careful to choose the version that works with your current version of windows.
If that is not an option, fall back to an earlier version of OpenCV that does not have dll dependencies, you can do that by:pip install opencv-python=3.3.0.9
Since windows rolled out it's N version this problem has been seen at many places, and has many impacts across the windows environment, the fastest way to identify if you have this problem is open youtube in Edge browser, if it says HTML5 media plugin not found, this is the problem.
Using pip to install opencv-python==3.3.0.9 worked for me, thanks! I'm using Anaconda 3, python 3.5.6 on a Windows 10 machine.
– CSharp
Jan 28 at 14:44
Thanks a lot! After countless hours of searching, this was the good answer. On Windows 10 N, you need to install the media feature pack. Thanks a lot!
– Phil
Feb 28 at 19:51
add a comment |
This can happen if you are using windows 10 N distribution, the N distributions does not come pre installed with windows media feature pack, which is required after OpenCV version 3.4 and onwards.
The preferred solution is to install the feature pack at : https://www.microsoft.com/en-us/software-download/mediafeaturepack
Be careful to choose the version that works with your current version of windows.
If that is not an option, fall back to an earlier version of OpenCV that does not have dll dependencies, you can do that by:pip install opencv-python=3.3.0.9
Since windows rolled out it's N version this problem has been seen at many places, and has many impacts across the windows environment, the fastest way to identify if you have this problem is open youtube in Edge browser, if it says HTML5 media plugin not found, this is the problem.
Using pip to install opencv-python==3.3.0.9 worked for me, thanks! I'm using Anaconda 3, python 3.5.6 on a Windows 10 machine.
– CSharp
Jan 28 at 14:44
Thanks a lot! After countless hours of searching, this was the good answer. On Windows 10 N, you need to install the media feature pack. Thanks a lot!
– Phil
Feb 28 at 19:51
add a comment |
This can happen if you are using windows 10 N distribution, the N distributions does not come pre installed with windows media feature pack, which is required after OpenCV version 3.4 and onwards.
The preferred solution is to install the feature pack at : https://www.microsoft.com/en-us/software-download/mediafeaturepack
Be careful to choose the version that works with your current version of windows.
If that is not an option, fall back to an earlier version of OpenCV that does not have dll dependencies, you can do that by:pip install opencv-python=3.3.0.9
Since windows rolled out it's N version this problem has been seen at many places, and has many impacts across the windows environment, the fastest way to identify if you have this problem is open youtube in Edge browser, if it says HTML5 media plugin not found, this is the problem.
This can happen if you are using windows 10 N distribution, the N distributions does not come pre installed with windows media feature pack, which is required after OpenCV version 3.4 and onwards.
The preferred solution is to install the feature pack at : https://www.microsoft.com/en-us/software-download/mediafeaturepack
Be careful to choose the version that works with your current version of windows.
If that is not an option, fall back to an earlier version of OpenCV that does not have dll dependencies, you can do that by:pip install opencv-python=3.3.0.9
Since windows rolled out it's N version this problem has been seen at many places, and has many impacts across the windows environment, the fastest way to identify if you have this problem is open youtube in Edge browser, if it says HTML5 media plugin not found, this is the problem.
answered Jan 23 at 6:40
anand_v.singhanand_v.singh
1,2561521
1,2561521
Using pip to install opencv-python==3.3.0.9 worked for me, thanks! I'm using Anaconda 3, python 3.5.6 on a Windows 10 machine.
– CSharp
Jan 28 at 14:44
Thanks a lot! After countless hours of searching, this was the good answer. On Windows 10 N, you need to install the media feature pack. Thanks a lot!
– Phil
Feb 28 at 19:51
add a comment |
Using pip to install opencv-python==3.3.0.9 worked for me, thanks! I'm using Anaconda 3, python 3.5.6 on a Windows 10 machine.
– CSharp
Jan 28 at 14:44
Thanks a lot! After countless hours of searching, this was the good answer. On Windows 10 N, you need to install the media feature pack. Thanks a lot!
– Phil
Feb 28 at 19:51
Using pip to install opencv-python==3.3.0.9 worked for me, thanks! I'm using Anaconda 3, python 3.5.6 on a Windows 10 machine.
– CSharp
Jan 28 at 14:44
Using pip to install opencv-python==3.3.0.9 worked for me, thanks! I'm using Anaconda 3, python 3.5.6 on a Windows 10 machine.
– CSharp
Jan 28 at 14:44
Thanks a lot! After countless hours of searching, this was the good answer. On Windows 10 N, you need to install the media feature pack. Thanks a lot!
– Phil
Feb 28 at 19:51
Thanks a lot! After countless hours of searching, this was the good answer. On Windows 10 N, you need to install the media feature pack. Thanks a lot!
– Phil
Feb 28 at 19:51
add a comment |
I had the same error (although I compiled OpenCV myself), in my case there were some DLL dependencies missing. You can check that with the program Dependency Walker.
Download Dependency Walker and run it, and open the file cv2.pyd with Dependency Walker, it should be in C:Program FilesPython37libsite-packagescv2
if the pip package installed correctly.
This program then scans for dependencies (which may take a few minutes) and it then shows missing DLL files in red.
1
thanks for your reply,your answer made me hopeful, i wake up at 4 AM for testing your advice, i download dependency walker and download all warning(yellow ones) dll's (not Ext.MS.* and Api.MS.*) and put them in system32 , but still not work. i can't figure out whats wrong, i run opencv in 2 local system today and it work perfectly but in my remote server is not ok.
– Neo Anderson
Sep 16 '18 at 6:51
add a comment |
I had the same error (although I compiled OpenCV myself), in my case there were some DLL dependencies missing. You can check that with the program Dependency Walker.
Download Dependency Walker and run it, and open the file cv2.pyd with Dependency Walker, it should be in C:Program FilesPython37libsite-packagescv2
if the pip package installed correctly.
This program then scans for dependencies (which may take a few minutes) and it then shows missing DLL files in red.
1
thanks for your reply,your answer made me hopeful, i wake up at 4 AM for testing your advice, i download dependency walker and download all warning(yellow ones) dll's (not Ext.MS.* and Api.MS.*) and put them in system32 , but still not work. i can't figure out whats wrong, i run opencv in 2 local system today and it work perfectly but in my remote server is not ok.
– Neo Anderson
Sep 16 '18 at 6:51
add a comment |
I had the same error (although I compiled OpenCV myself), in my case there were some DLL dependencies missing. You can check that with the program Dependency Walker.
Download Dependency Walker and run it, and open the file cv2.pyd with Dependency Walker, it should be in C:Program FilesPython37libsite-packagescv2
if the pip package installed correctly.
This program then scans for dependencies (which may take a few minutes) and it then shows missing DLL files in red.
I had the same error (although I compiled OpenCV myself), in my case there were some DLL dependencies missing. You can check that with the program Dependency Walker.
Download Dependency Walker and run it, and open the file cv2.pyd with Dependency Walker, it should be in C:Program FilesPython37libsite-packagescv2
if the pip package installed correctly.
This program then scans for dependencies (which may take a few minutes) and it then shows missing DLL files in red.
edited Sep 25 '18 at 9:25
NIMISHAN
94811223
94811223
answered Sep 15 '18 at 23:46
VenifyVenify
435110
435110
1
thanks for your reply,your answer made me hopeful, i wake up at 4 AM for testing your advice, i download dependency walker and download all warning(yellow ones) dll's (not Ext.MS.* and Api.MS.*) and put them in system32 , but still not work. i can't figure out whats wrong, i run opencv in 2 local system today and it work perfectly but in my remote server is not ok.
– Neo Anderson
Sep 16 '18 at 6:51
add a comment |
1
thanks for your reply,your answer made me hopeful, i wake up at 4 AM for testing your advice, i download dependency walker and download all warning(yellow ones) dll's (not Ext.MS.* and Api.MS.*) and put them in system32 , but still not work. i can't figure out whats wrong, i run opencv in 2 local system today and it work perfectly but in my remote server is not ok.
– Neo Anderson
Sep 16 '18 at 6:51
1
1
thanks for your reply,your answer made me hopeful, i wake up at 4 AM for testing your advice, i download dependency walker and download all warning(yellow ones) dll's (not Ext.MS.* and Api.MS.*) and put them in system32 , but still not work. i can't figure out whats wrong, i run opencv in 2 local system today and it work perfectly but in my remote server is not ok.
– Neo Anderson
Sep 16 '18 at 6:51
thanks for your reply,your answer made me hopeful, i wake up at 4 AM for testing your advice, i download dependency walker and download all warning(yellow ones) dll's (not Ext.MS.* and Api.MS.*) and put them in system32 , but still not work. i can't figure out whats wrong, i run opencv in 2 local system today and it work perfectly but in my remote server is not ok.
– Neo Anderson
Sep 16 '18 at 6:51
add a comment |
Can you try uninstalling opencv and installing it using a wheel file instead? Here is a website that has many versions of OpenCV compiled for windows, search for the one you need and simply install it with pip
command.
So if you have Python 3.6 (64 Bit) and wish to install OpenCV 3.4.3 then download the wheel file:opencv_python‑3.4.3‑cp36‑cp36m‑win_amd64.whl
1
i test almost 10 of them ! but missing dll is appers on all of them.
– Neo Anderson
Sep 17 '18 at 17:11
add a comment |
Can you try uninstalling opencv and installing it using a wheel file instead? Here is a website that has many versions of OpenCV compiled for windows, search for the one you need and simply install it with pip
command.
So if you have Python 3.6 (64 Bit) and wish to install OpenCV 3.4.3 then download the wheel file:opencv_python‑3.4.3‑cp36‑cp36m‑win_amd64.whl
1
i test almost 10 of them ! but missing dll is appers on all of them.
– Neo Anderson
Sep 17 '18 at 17:11
add a comment |
Can you try uninstalling opencv and installing it using a wheel file instead? Here is a website that has many versions of OpenCV compiled for windows, search for the one you need and simply install it with pip
command.
So if you have Python 3.6 (64 Bit) and wish to install OpenCV 3.4.3 then download the wheel file:opencv_python‑3.4.3‑cp36‑cp36m‑win_amd64.whl
Can you try uninstalling opencv and installing it using a wheel file instead? Here is a website that has many versions of OpenCV compiled for windows, search for the one you need and simply install it with pip
command.
So if you have Python 3.6 (64 Bit) and wish to install OpenCV 3.4.3 then download the wheel file:opencv_python‑3.4.3‑cp36‑cp36m‑win_amd64.whl
answered Sep 17 '18 at 15:39
Rakshith GbRakshith Gb
401518
401518
1
i test almost 10 of them ! but missing dll is appers on all of them.
– Neo Anderson
Sep 17 '18 at 17:11
add a comment |
1
i test almost 10 of them ! but missing dll is appers on all of them.
– Neo Anderson
Sep 17 '18 at 17:11
1
1
i test almost 10 of them ! but missing dll is appers on all of them.
– Neo Anderson
Sep 17 '18 at 17:11
i test almost 10 of them ! but missing dll is appers on all of them.
– Neo Anderson
Sep 17 '18 at 17:11
add a comment |
Python 3.7 may not support some modules.
- Try installing python 3.6.4
- Using command prompt, "pip install
opencv" or "pip install opencv-python" - Import cv2
1
Thanks man! I had the same problem and downgrading to 3.6.4 worked for me. But when do you think they will fix this by?
– ѕняєє ѕιиgнι
Sep 22 '18 at 11:37
add a comment |
Python 3.7 may not support some modules.
- Try installing python 3.6.4
- Using command prompt, "pip install
opencv" or "pip install opencv-python" - Import cv2
1
Thanks man! I had the same problem and downgrading to 3.6.4 worked for me. But when do you think they will fix this by?
– ѕняєє ѕιиgнι
Sep 22 '18 at 11:37
add a comment |
Python 3.7 may not support some modules.
- Try installing python 3.6.4
- Using command prompt, "pip install
opencv" or "pip install opencv-python" - Import cv2
Python 3.7 may not support some modules.
- Try installing python 3.6.4
- Using command prompt, "pip install
opencv" or "pip install opencv-python" - Import cv2
answered Sep 22 '18 at 10:33
Vikhyat AgarwalVikhyat Agarwal
528518
528518
1
Thanks man! I had the same problem and downgrading to 3.6.4 worked for me. But when do you think they will fix this by?
– ѕняєє ѕιиgнι
Sep 22 '18 at 11:37
add a comment |
1
Thanks man! I had the same problem and downgrading to 3.6.4 worked for me. But when do you think they will fix this by?
– ѕняєє ѕιиgнι
Sep 22 '18 at 11:37
1
1
Thanks man! I had the same problem and downgrading to 3.6.4 worked for me. But when do you think they will fix this by?
– ѕняєє ѕιиgнι
Sep 22 '18 at 11:37
Thanks man! I had the same problem and downgrading to 3.6.4 worked for me. But when do you think they will fix this by?
– ѕняєє ѕιиgнι
Sep 22 '18 at 11:37
add a comment |
I have faced the similar issue in Windows Server 2012 r2. After lot of findings I found that mfplat.dll was missing which is related to Window Media Service.
Hence you have to manually install the features so that you can get dll related to window media service.
- Turn windows features on or off
- Skip the roles screen and directly go to Feature screen
- Select "Desktop Experience" under "User Interfaces and Infrastructure"
After this all required dll of opencv would be available.
add a comment |
I have faced the similar issue in Windows Server 2012 r2. After lot of findings I found that mfplat.dll was missing which is related to Window Media Service.
Hence you have to manually install the features so that you can get dll related to window media service.
- Turn windows features on or off
- Skip the roles screen and directly go to Feature screen
- Select "Desktop Experience" under "User Interfaces and Infrastructure"
After this all required dll of opencv would be available.
add a comment |
I have faced the similar issue in Windows Server 2012 r2. After lot of findings I found that mfplat.dll was missing which is related to Window Media Service.
Hence you have to manually install the features so that you can get dll related to window media service.
- Turn windows features on or off
- Skip the roles screen and directly go to Feature screen
- Select "Desktop Experience" under "User Interfaces and Infrastructure"
After this all required dll of opencv would be available.
I have faced the similar issue in Windows Server 2012 r2. After lot of findings I found that mfplat.dll was missing which is related to Window Media Service.
Hence you have to manually install the features so that you can get dll related to window media service.
- Turn windows features on or off
- Skip the roles screen and directly go to Feature screen
- Select "Desktop Experience" under "User Interfaces and Infrastructure"
After this all required dll of opencv would be available.
answered Nov 5 '18 at 15:43
BiksBiks
244310
244310
add a comment |
add a comment |
i was suffering from the same problem "DLL load failed" after reading tons of answers and articles i got a solution.
i don't know this works for you or not but give it a try.
tools and versions i used: anaconda - 5.3.1, python - 3.7, win 10 (64 bit)
Steps i performed :
step1:i installed opencv 3.4.4 from here
then extract into C drive (you can do wherever you want)
step2: copy cv2.pyd file from [C:opencvbuildpythoncv2python-3.7] here to [C:Users"user-name"Anaconda3Libsite-packages] here.
step3: run dependency walker to detect which dll files are missing,
after running dependency walker in my case it showed two dll files are not loading, they are (1)OPENCV_WORLD344.DLL and (2)IESHIMS.DLL.
i don't know about your situation but you can do this-> find files name using dependency walker then find their path and follow step4.
step4: open System property->Advanced->Environment variables, now edit path and add C:opencvbuildx64vc14bin (in my case this was the place where OPENCV_WORLD344.DLL is stored) and after doing this, import cv2 in python.
If my answer does not work then add a comment.
add a comment |
i was suffering from the same problem "DLL load failed" after reading tons of answers and articles i got a solution.
i don't know this works for you or not but give it a try.
tools and versions i used: anaconda - 5.3.1, python - 3.7, win 10 (64 bit)
Steps i performed :
step1:i installed opencv 3.4.4 from here
then extract into C drive (you can do wherever you want)
step2: copy cv2.pyd file from [C:opencvbuildpythoncv2python-3.7] here to [C:Users"user-name"Anaconda3Libsite-packages] here.
step3: run dependency walker to detect which dll files are missing,
after running dependency walker in my case it showed two dll files are not loading, they are (1)OPENCV_WORLD344.DLL and (2)IESHIMS.DLL.
i don't know about your situation but you can do this-> find files name using dependency walker then find their path and follow step4.
step4: open System property->Advanced->Environment variables, now edit path and add C:opencvbuildx64vc14bin (in my case this was the place where OPENCV_WORLD344.DLL is stored) and after doing this, import cv2 in python.
If my answer does not work then add a comment.
add a comment |
i was suffering from the same problem "DLL load failed" after reading tons of answers and articles i got a solution.
i don't know this works for you or not but give it a try.
tools and versions i used: anaconda - 5.3.1, python - 3.7, win 10 (64 bit)
Steps i performed :
step1:i installed opencv 3.4.4 from here
then extract into C drive (you can do wherever you want)
step2: copy cv2.pyd file from [C:opencvbuildpythoncv2python-3.7] here to [C:Users"user-name"Anaconda3Libsite-packages] here.
step3: run dependency walker to detect which dll files are missing,
after running dependency walker in my case it showed two dll files are not loading, they are (1)OPENCV_WORLD344.DLL and (2)IESHIMS.DLL.
i don't know about your situation but you can do this-> find files name using dependency walker then find their path and follow step4.
step4: open System property->Advanced->Environment variables, now edit path and add C:opencvbuildx64vc14bin (in my case this was the place where OPENCV_WORLD344.DLL is stored) and after doing this, import cv2 in python.
If my answer does not work then add a comment.
i was suffering from the same problem "DLL load failed" after reading tons of answers and articles i got a solution.
i don't know this works for you or not but give it a try.
tools and versions i used: anaconda - 5.3.1, python - 3.7, win 10 (64 bit)
Steps i performed :
step1:i installed opencv 3.4.4 from here
then extract into C drive (you can do wherever you want)
step2: copy cv2.pyd file from [C:opencvbuildpythoncv2python-3.7] here to [C:Users"user-name"Anaconda3Libsite-packages] here.
step3: run dependency walker to detect which dll files are missing,
after running dependency walker in my case it showed two dll files are not loading, they are (1)OPENCV_WORLD344.DLL and (2)IESHIMS.DLL.
i don't know about your situation but you can do this-> find files name using dependency walker then find their path and follow step4.
step4: open System property->Advanced->Environment variables, now edit path and add C:opencvbuildx64vc14bin (in my case this was the place where OPENCV_WORLD344.DLL is stored) and after doing this, import cv2 in python.
If my answer does not work then add a comment.
edited Dec 27 '18 at 5:46
answered Nov 23 '18 at 14:33
Rhythm sharmaRhythm sharma
516
516
add a comment |
add a comment |
After 15 days of brain storming, This solution worked for me. And I am sure that it will work for you too. I installed anaconda to use OpenCV 3.1.0. I followed following Steps:
1) I have installed anaconda-5.3 64-bit installer (614.3 MB) which uses python 3.7. You can download anaconda from link: https://www.anaconda.com/download/#windows
2) After installation of anaconda, open anaconda prompt by typing "anaconda prompt" on windows start button. Open with "Run as administrator".
3) You have to create new environment to install and use OpenCV module.Write following commands to create and activate new environment:>conda create --name myNewEnv python=3.5.0
>activate myNewEnv
"myNewEnv" is the name of new enviroment.
4)Now you need to install prerequisite for OpenCV, which is numpy and then install opencv3. Start internet before executing following commands:>conda install numpy
>conda install anaconda-client
>conda install --channel https://conda.anaconda.org/menpo opencv3
5)OpenCV3 has been installed. Now, verify installation by executing following commands:(myNewEnv) C:UsersNilesh> python
>>>import cv2
>>>cv2.__version__
Follow steps given below, when you want to start OpenCV3 second time onwards:
1) Open "anaconda command promt" from start menu with "run as administrator" rights
2) Type command >activate your_new_environment_name
3) Assume that you want to run file located on desktop, for that write following command:> cd C:UsersNileshDesktop
4) Now your working directory is Desktop.
5) Type following command to run any code (for example test.py).> python test.py
Note: Here, python means version-3.
I hope this solution will work for you.
add a comment |
After 15 days of brain storming, This solution worked for me. And I am sure that it will work for you too. I installed anaconda to use OpenCV 3.1.0. I followed following Steps:
1) I have installed anaconda-5.3 64-bit installer (614.3 MB) which uses python 3.7. You can download anaconda from link: https://www.anaconda.com/download/#windows
2) After installation of anaconda, open anaconda prompt by typing "anaconda prompt" on windows start button. Open with "Run as administrator".
3) You have to create new environment to install and use OpenCV module.Write following commands to create and activate new environment:>conda create --name myNewEnv python=3.5.0
>activate myNewEnv
"myNewEnv" is the name of new enviroment.
4)Now you need to install prerequisite for OpenCV, which is numpy and then install opencv3. Start internet before executing following commands:>conda install numpy
>conda install anaconda-client
>conda install --channel https://conda.anaconda.org/menpo opencv3
5)OpenCV3 has been installed. Now, verify installation by executing following commands:(myNewEnv) C:UsersNilesh> python
>>>import cv2
>>>cv2.__version__
Follow steps given below, when you want to start OpenCV3 second time onwards:
1) Open "anaconda command promt" from start menu with "run as administrator" rights
2) Type command >activate your_new_environment_name
3) Assume that you want to run file located on desktop, for that write following command:> cd C:UsersNileshDesktop
4) Now your working directory is Desktop.
5) Type following command to run any code (for example test.py).> python test.py
Note: Here, python means version-3.
I hope this solution will work for you.
add a comment |
After 15 days of brain storming, This solution worked for me. And I am sure that it will work for you too. I installed anaconda to use OpenCV 3.1.0. I followed following Steps:
1) I have installed anaconda-5.3 64-bit installer (614.3 MB) which uses python 3.7. You can download anaconda from link: https://www.anaconda.com/download/#windows
2) After installation of anaconda, open anaconda prompt by typing "anaconda prompt" on windows start button. Open with "Run as administrator".
3) You have to create new environment to install and use OpenCV module.Write following commands to create and activate new environment:>conda create --name myNewEnv python=3.5.0
>activate myNewEnv
"myNewEnv" is the name of new enviroment.
4)Now you need to install prerequisite for OpenCV, which is numpy and then install opencv3. Start internet before executing following commands:>conda install numpy
>conda install anaconda-client
>conda install --channel https://conda.anaconda.org/menpo opencv3
5)OpenCV3 has been installed. Now, verify installation by executing following commands:(myNewEnv) C:UsersNilesh> python
>>>import cv2
>>>cv2.__version__
Follow steps given below, when you want to start OpenCV3 second time onwards:
1) Open "anaconda command promt" from start menu with "run as administrator" rights
2) Type command >activate your_new_environment_name
3) Assume that you want to run file located on desktop, for that write following command:> cd C:UsersNileshDesktop
4) Now your working directory is Desktop.
5) Type following command to run any code (for example test.py).> python test.py
Note: Here, python means version-3.
I hope this solution will work for you.
After 15 days of brain storming, This solution worked for me. And I am sure that it will work for you too. I installed anaconda to use OpenCV 3.1.0. I followed following Steps:
1) I have installed anaconda-5.3 64-bit installer (614.3 MB) which uses python 3.7. You can download anaconda from link: https://www.anaconda.com/download/#windows
2) After installation of anaconda, open anaconda prompt by typing "anaconda prompt" on windows start button. Open with "Run as administrator".
3) You have to create new environment to install and use OpenCV module.Write following commands to create and activate new environment:>conda create --name myNewEnv python=3.5.0
>activate myNewEnv
"myNewEnv" is the name of new enviroment.
4)Now you need to install prerequisite for OpenCV, which is numpy and then install opencv3. Start internet before executing following commands:>conda install numpy
>conda install anaconda-client
>conda install --channel https://conda.anaconda.org/menpo opencv3
5)OpenCV3 has been installed. Now, verify installation by executing following commands:(myNewEnv) C:UsersNilesh> python
>>>import cv2
>>>cv2.__version__
Follow steps given below, when you want to start OpenCV3 second time onwards:
1) Open "anaconda command promt" from start menu with "run as administrator" rights
2) Type command >activate your_new_environment_name
3) Assume that you want to run file located on desktop, for that write following command:> cd C:UsersNileshDesktop
4) Now your working directory is Desktop.
5) Type following command to run any code (for example test.py).> python test.py
Note: Here, python means version-3.
I hope this solution will work for you.
answered Jan 8 at 18:11
NellNell
111
111
add a comment |
add a comment |
I had similar issue except that I'm using Anaconda3 and this code here solved it:
conda install -c anaconda py-OpenCV
add a comment |
I had similar issue except that I'm using Anaconda3 and this code here solved it:
conda install -c anaconda py-OpenCV
add a comment |
I had similar issue except that I'm using Anaconda3 and this code here solved it:
conda install -c anaconda py-OpenCV
I had similar issue except that I'm using Anaconda3 and this code here solved it:
conda install -c anaconda py-OpenCV
edited Nov 13 '18 at 19:57
Cris Luengo
22.4k52253
22.4k52253
answered Oct 25 '18 at 15:12
Omda asliOmda asli
11
11
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52349669%2fdll-load-failed-when-import-cv2-opencv%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
See this question
– Alistair Carscadden
Sep 17 '18 at 3:53
Can you try to add the .dll file to the same folder as the .pyd file? Maybe the remote server isn't checking in system32.dll?
– Daren Thomas
Sep 19 '18 at 12:29