nagyistoce / pyopencv

Automatically exported from code.google.com/p/pyopencv
0 stars 0 forks source link

import cxtypes_h_ext as _ext. DLL load failed. #30

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1.Install pyopencv-2.1.0.wr1.2.0.win32-py2.6.exe
2. import pyopencv as cv

When i import pyopencv it fails with the following error:

from pyopencv import *
  File "C:\Python26\lib\site-packages\pyopencv\__init__.py", line 1, in <module>
    from info import __doc__
  File "C:\Python26\lib\site-packages\pyopencv\info.py", line 42, in <module>
    import config as _cfg
  File "C:\Python26\lib\site-packages\pyopencv\config.py", line 7, in <module>
    from cxtypes_h import *
  File "C:\Python26\lib\site-packages\pyopencv\cxtypes_h.py", line 19, in <module>
    import cxtypes_h_ext as _ext
ImportError: DLL load failed: Invalid access to memory location.

Am using python 2.6 in Windows 7. Also am using pythonxy, maybe its causing 
conflicts with prior versions of pyopencv. Any help will be appreciated. 

Thank you in advance.

Original issue reported on code.google.com by rault...@gmail.com on 28 Oct 2010 at 3:28

GoogleCodeExporter commented 9 years ago
I also got the same error under the same circumstances. I am using an older of 
pyopencv instead, which works.

Original comment by engn...@gmail.com on 3 Nov 2010 at 11:31

GoogleCodeExporter commented 9 years ago
Thanks. I must have forgotten to include a necessary DLL file in that binary 
distribution. I'll take a look as soon as I can, probably this weekend or the 
next. Sorry, I'm going through a difficult time at work at the moment.

Cheers,
Minh-Tri

Original comment by pmtri80@gmail.com on 4 Nov 2010 at 5:16

GoogleCodeExporter commented 9 years ago
I was unable to reproduce the problem unfortunately. However, I ran Dependency 
Walker (http://dependencywalker.com/) on the 'cxtypes_h_ext.pyd' file to 
determine which DLL files had been loaded and below is the list. 

c:\python26\lib\site-packages\pyopencv\CXTYPES_H_EXT.PYD
c:\windows\system32\KERNEL32.DLL
c:\windows\system32\MSVCRT.DLL
c:\python26\lib\site-packages\pyopencv\LIBCXCORE210.DLL
c:\python26\lib\site-packages\pyopencv\BOOST_PYTHON-MGW44-MT-1_42.DLL
c:\windows\system32\PYTHON26.DLL
c:\python26\lib\site-packages\pyopencv\PYOPENCV_EXTRAS.DLL
c:\python26\lib\site-packages\pyopencv\LIBCV210.DLL
c:\python26\lib\site-packages\pyopencv\LIBCXCORE210.DLL
c:\python26\lib\site-packages\pyopencv\TBB.DLL

I reckon that you also use Dependency Walker on the 'CXTYPES_H_EXT.PYD' file on 
your machine to determine which DLL file was not properly loaded. I have found 
this tool very useful in situations like this.

Cheers,
Minh-Tri

Original comment by pmtri80@gmail.com on 7 Nov 2010 at 9:05

GoogleCodeExporter commented 9 years ago
Hi,
I am also having the same issue on my XP desktop machine after updating to 
wr1.2.0. Strangely, it works just fine on my netbook (also XP). On the desktop, 
I tried Python version 2.6.1, 2.6.6 and 2.6.5, in that order (initially 
installed, latest '2.6', and the version on the netbook, respectively) with no 
change. I even tried deleting the contents of \site-packages\pyopencv and 
copying the files from the netbook in (no change).

Per the suggestion above I ran Dependency Walker on both sides. Strangely, the 
netbook copy returns more 'errors' than the desktop, despite seeming to work 
perfectly. I am not sure how to interpret its output, but hopefully some of 
this helps.

Using the trace function on python.exe (as described in another thread for the 
same type of error in an unrelated project: 
http://groups.google.com/group/ankisrs/browse_thread/thread/c3f022ca48fa5b51 ) 
reveals the following:

Error/warnings in the middle pane:

Netbook: missing files (EFSADU.DLL, IESHIMS.DLL, WER.DLL, IRML.DLL), "red icon" 
warning (missing import/export?) for KERNEL32.DLL, MPR.DLL, MSCTFIME.DLL.
Desktop: missing files (IRML.DLL), warning for KERNEL32.DLL, MPR.DLL, 
CXTYPES_H_EXT.PYD.

Clicking the corresponding CXTYPES... entry in the top left pane shows no 
obvious reason it is marked in red, but slightly different result in the 
righthand pane: on the netbook, there is an entry for 'initcxtypes_h_ext' in 
both the top and bottom sections, but on the PC, only in the bottom section 
(exports?). The log files from the traces show a difference that seems to be 
relevant. The corresponding sections when first loading CXTYPES_H_EXT.PYD:

Netbook:

...
LoadLibraryExA("c:\python26\lib\site-packages\pyopencv\cxtypes_h_ext.pyd", 
0x00000000, LOAD_WITH_ALTERED_SEARCH_PATH) called from "PYTHON26.DLL" at 
address 0x1E02AD49.
Loaded "CXTYPES_H_EXT.PYD" at address 0x011A0000.  Successfully hooked module.
Loaded "LIBCXCORE210.DLL" at address 0x70640000.  Successfully hooked module.
Loaded "BOOST_PYTHON-MGW44-MT-1_42.DLL" at address 0x66880000.  Successfully 
hooked module.
Loaded "PYOPENCV_EXTRAS.DLL" at address 0x67180000.  Successfully hooked module.
Loaded "LIBCV210.DLL" at address 0x69280000.  Successfully hooked module.
Loaded "TBB.DLL" at address 0x676C0000.  Successfully hooked module.
DllMain(0x70640000, DLL_PROCESS_ATTACH, 0x00000000) in "LIBCXCORE210.DLL" 
called.
DllMain(0x70640000, DLL_PROCESS_ATTACH, 0x00000000) in "LIBCXCORE210.DLL" 
returned 1 (0x1).
DllMain(0x66880000, DLL_PROCESS_ATTACH, 0x00000000) in 
"BOOST_PYTHON-MGW44-MT-1_42.DLL" called.
DllMain(0x66880000, DLL_PROCESS_ATTACH, 0x00000000) in 
"BOOST_PYTHON-MGW44-MT-1_42.DLL" returned 1 (0x1).
DllMain(0x676C0000, DLL_PROCESS_ATTACH, 0x00000000) in "TBB.DLL" called.
LoadLibraryA("irml.dll") called from "TBB.DLL" at address 0x676C4252.
LoadLibraryA("irml.dll") returned NULL. Error: The specified module could not 
be found (126).
DllMain(0x676C0000, DLL_PROCESS_ATTACH, 0x00000000) in "TBB.DLL" returned 1 
(0x1).
DllMain(0x69280000, DLL_PROCESS_ATTACH, 0x00000000) in "LIBCV210.DLL" called.
DllMain(0x69280000, DLL_PROCESS_ATTACH, 0x00000000) in "LIBCV210.DLL" returned 
1 (0x1).
DllMain(0x67180000, DLL_PROCESS_ATTACH, 0x00000000) in "PYOPENCV_EXTRAS.DLL" 
called.
DllMain(0x67180000, DLL_PROCESS_ATTACH, 0x00000000) in "PYOPENCV_EXTRAS.DLL" 
returned 1 (0x1).
DllMain(0x011A0000, DLL_PROCESS_ATTACH, 0x00000000) in "CXTYPES_H_EXT.PYD" 
called.
DllMain(0x011A0000, DLL_PROCESS_ATTACH, 0x00000000) in "CXTYPES_H_EXT.PYD" 
returned 1 (0x1).
LoadLibraryExA("c:\python26\lib\site-packages\pyopencv\cxtypes_h_ext.pyd", 
0x00000000, LOAD_WITH_ALTERED_SEARCH_PATH) returned 0x011A0000.
GetProcAddress(0x011A0000 [CXTYPES_H_EXT.PYD], "initcxtypes_h_ext") called from 
"PYTHON26.DLL" at address 0x1E02ADAB and returned 0x011A135C.
LoadLibraryExA("c:\python26\lib\site-packages\pyopencv\cxcore_h_ext.pyd", 
0x00000000, LOAD_WITH_ALTERED_SEARCH_PATH) called from "PYTHON26.DLL" at 
address 0x1E02AD49.
Loaded "CXCORE_H_EXT.PYD" at address 0x687C0000.  Successfully hooked module.
DllMain(0x687C0000, DLL_PROCESS_ATTACH, 0x00000000) in "CXCORE_H_EXT.PYD" 
called.
DllMain(0x687C0000, DLL_PROCESS_ATTACH, 0x00000000) in "CXCORE_H_EXT.PYD" 
returned 1 (0x1).
LoadLibraryExA("c:\python26\lib\site-packages\pyopencv\cxcore_h_ext.pyd", 
0x00000000, LOAD_WITH_ALTERED_SEARCH_PATH) returned 0x687C0000.
GetProcAddress(0x687C0000 [CXCORE_H_EXT.PYD], "initcxcore_h_ext") called from 
"PYTHON26.DLL" at address 0x1E02ADAB and returned 0x687C14B8.
...

Desktop PC:

...
LoadLibraryExA("c:\python26\lib\site-packages\pyopencv\cxtypes_h_ext.pyd", 
0x00000000, LOAD_WITH_ALTERED_SEARCH_PATH) called from "PYTHON26.DLL" at 
address 0x1E02AFA9.
Loaded "CXTYPES_H_EXT.PYD" at address 0x01290000.  Successfully hooked module.
Loaded "LIBCXCORE210.DLL" at address 0x70640000.  Successfully hooked module.
Loaded "BOOST_PYTHON-MGW44-MT-1_42.DLL" at address 0x66880000.  Successfully 
hooked module.
Loaded "PYOPENCV_EXTRAS.DLL" at address 0x67180000.  Successfully hooked module.
Loaded "LIBCV210.DLL" at address 0x69280000.  Successfully hooked module.
Loaded "TBB.DLL" at address 0x676C0000.  Successfully hooked module.
DllMain(0x70640000, DLL_PROCESS_ATTACH, 0x00000000) in "LIBCXCORE210.DLL" 
called.
DllMain(0x70640000, DLL_PROCESS_ATTACH, 0x00000000) in "LIBCXCORE210.DLL" 
returned 1 (0x1).
DllMain(0x66880000, DLL_PROCESS_ATTACH, 0x00000000) in 
"BOOST_PYTHON-MGW44-MT-1_42.DLL" called.
DllMain(0x66880000, DLL_PROCESS_ATTACH, 0x00000000) in 
"BOOST_PYTHON-MGW44-MT-1_42.DLL" returned 1 (0x1).
DllMain(0x676C0000, DLL_PROCESS_ATTACH, 0x00000000) in "TBB.DLL" called.
LoadLibraryA("irml.dll") called from "TBB.DLL" at address 0x676C4252.
LoadLibraryA("irml.dll") returned NULL. Error: The specified module could not 
be found (126).
DllMain(0x676C0000, DLL_PROCESS_ATTACH, 0x00000000) in "TBB.DLL" returned 1 
(0x1).
DllMain(0x69280000, DLL_PROCESS_ATTACH, 0x00000000) in "LIBCV210.DLL" called.
DllMain(0x69280000, DLL_PROCESS_ATTACH, 0x00000000) in "LIBCV210.DLL" returned 
1 (0x1).
DllMain(0x67180000, DLL_PROCESS_ATTACH, 0x00000000) in "PYOPENCV_EXTRAS.DLL" 
called.
DllMain(0x69280000, DLL_PROCESS_DETACH, 0x00000000) in "LIBCV210.DLL" called.
DllMain(0x69280000, DLL_PROCESS_DETACH, 0x00000000) in "LIBCV210.DLL" returned 
1 (0x1).
DllMain(0x676C0000, DLL_PROCESS_DETACH, 0x00000000) in "TBB.DLL" called.
DllMain(0x676C0000, DLL_PROCESS_DETACH, 0x00000000) in "TBB.DLL" returned 1 
(0x1).
DllMain(0x66880000, DLL_PROCESS_DETACH, 0x00000000) in 
"BOOST_PYTHON-MGW44-MT-1_42.DLL" called.
DllMain(0x66880000, DLL_PROCESS_DETACH, 0x00000000) in 
"BOOST_PYTHON-MGW44-MT-1_42.DLL" returned 1 (0x1).
DllMain(0x70640000, DLL_PROCESS_DETACH, 0x00000000) in "LIBCXCORE210.DLL" 
called.
DllMain(0x70640000, DLL_PROCESS_DETACH, 0x00000000) in "LIBCXCORE210.DLL" 
returned 1 (0x1).
Unloaded "CXTYPES_H_EXT.PYD" at address 0x01290000.
Unloaded "PYOPENCV_EXTRAS.DLL" at address 0x67180000.
Unloaded "LIBCV210.DLL" at address 0x69280000.
Unloaded "TBB.DLL" at address 0x676C0000.
Unloaded "BOOST_PYTHON-MGW44-MT-1_42.DLL" at address 0x66880000.
Unloaded "LIBCXCORE210.DLL" at address 0x70640000.
LoadLibraryExA("c:\python26\lib\site-packages\pyopencv\cxtypes_h_ext.pyd", 
0x00000000, LOAD_WITH_ALTERED_SEARCH_PATH) returned NULL. Error: Invalid access 
to memory location (998).
DllMain(0x1D1A0000, DLL_PROCESS_DETACH, 0x00000001) in "_CTYPES.PYD" called.
DllMain(0x1D1A0000, DLL_PROCESS_DETACH, 0x00000001) in "_CTYPES.PYD" returned 1 
(0x1).
...

Notice that on the desktop's trace, it seems to fail near
DllMain(0x67180000, DLL_PROCESS_ATTACH, 0x00000000) in "PYOPENCV_EXTRAS.DLL" 
called.
After this, it begins unloading modules(?) (PROCESS_DETACH) before reporting 
the error (Error: Invalid access to memory location (998)), and continues 
apparently shutting down. The full logs of each are attached.

Hope this helps!
Tim

Original comment by drmn...@gmail.com on 9 Dec 2010 at 5:42

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks.

Unfortunately, I don't have time to investigate the matter now. However, my 
wild guess is that you just need EFSADU.DLL installed on your machine. This is 
probably because I compiled the 1.2.0 Windows binary on my new Windows 7 
platform. I had compiled previous versions on my XP platform though. I'll take 
a deeper look probably this weekend or the next.

Cheers,
Minh-Tri

Original comment by pmtri80@gmail.com on 9 Dec 2010 at 9:39

GoogleCodeExporter commented 9 years ago
No problem. If you do decide to chase this bug, let me know if I can
be of help - I can reproduce the problem reliably and have a working
installation on another machine to compare against.

PS. I don't think EFSADU.DLL is the issue; the machine with it NOT
installed is the one that works! (Maybe I should try hiding that file
from opencv/windows on the other one... :-)

Tim

Original comment by drmn...@gmail.com on 14 Dec 2010 at 6:06

GoogleCodeExporter commented 9 years ago
Hi guys,
I've encountered the same problem and since time has passed since december, I 
was wondering if anyone has solved it yet?
Thx in advance, Shachar

Original comment by shach...@gmail.com on 20 Mar 2011 at 6:35

GoogleCodeExporter commented 9 years ago
I am also facing the same bug.
win xp 32
python 2.6.2

Original comment by animator...@gmail.com on 20 Apr 2011 at 12:10