Python 缺少文件或文件不兼容:导入错误:DLL加载失败:%1不是有效的Win32应用程序 问题:

Python 缺少文件或文件不兼容:导入错误:DLL加载失败:%1不是有效的Win32应用程序 问题:,python,tesseract,dependency-walker,python-tesseract,Python,Tesseract,Dependency Walker,Python Tesseract,尝试导入到我的项目(OCR功能)时出现此错误: ImportError:DLL加载失败:%1不是有效的Win32应用程序。 我不知道到底是什么问题 我没有技能和知识来追踪这种问题的根源 背景: 据我所知,tesseract是一个32位的应用程序。我正在运行Windows7,64位和64位python。其他人似乎在这些条件下运行tesseract,但他们并不理想,可能会造成这种挑战 堆栈跟踪 这是PyCharm的错误跟踪。如您所见,它没有指定出现问题的文件,而是说它找不到看起来是字符串格式的参

尝试导入到我的项目(OCR功能)时出现此错误:

ImportError:DLL加载失败:%1不是有效的Win32应用程序。

  • 我不知道到底是什么问题
  • 我没有技能和知识来追踪这种问题的根源
背景: 据我所知,tesseract是一个32位的应用程序。我正在运行Windows7,64位和64位python。其他人似乎在这些条件下运行tesseract,但他们并不理想,可能会造成这种挑战

堆栈跟踪 这是PyCharm的错误跟踪。如您所见,它没有指定出现问题的文件,而是说它找不到看起来是字符串格式的参数:
%1

Traceback (most recent call last): File "C:\Program Files (x86)\JetBrains\PyCharm 2.7.3\helpers\pydev\pydevd.py", line 1481, in debugger.run(setup['file'], None, None) File "C:\Program Files (x86)\JetBrains\PyCharm 2.7.3\helpers\pydev\pydevd.py", line 1124, in run pydev_imports.execfile(file, globals, locals) #execute the script File "C:/Dropbox/COC/automate/coc_automate/python/__init__.py", line 7, in import tesseract File "C:\Python27\lib\site-packages\tesseract.py", line 28, in _tesseract = swig_import_helper() File "C:\Python27\lib\site-packages\tesseract.py", line 22, in swig_import_helper _mod = imp.load_module('_tesseract', fp, pathname, description) ImportError: DLL load failed: %1 is not a valid Win32 application. 屏幕截图:


< /p> < p>作为Visual C++ 2008运行时的一部分提供MSVCR90.DLL。您似乎需要在此处下载并安装运行时:

作为旁注,在python tesseract页面上,它说:

VS2008编译的Windows版本现在可用


似乎有人选择编译应用程序以要求使用运行时msvc++2008运行时,而不是静态链接运行时库。您可能需要请求他们对其进行更改,因为在您想要运行python脚本的任何工作站上使用该python模块都会增加额外的要求。

此外,维护人员似乎不太确定如何使安装包支持x64。你可能有一个几乎没有人测试过的版本。看啊,我忘了加这个了:我已经试过安装Visual C++ 2008运行时,它说我已经在我的系统上拥有它了。然后它对2010年运行时说了同样的话。你安装了2008年运行时的哪个版本?x86还是x64?根据上面的评论,您可能需要安装x86版本。 PYTHON27.DLL Error opening file. The system cannot find the file specified (2). API-MS-WIN-CORE-COM-L1-1-0.DLL The system cannot find the file specified (2). API-MS-WIN-CORE-WINRT-ERROR-L1-1-0.DLL The system cannot find the file specified (2). API-MS-WIN-CORE-WINRT-L1-1-0.DLL The system cannot find the file specified (2). API-MS-WIN-CORE-WINRT-ROBUFFER-L1-1-0.DLL The system cannot find the file specified (2). API-MS-WIN-CORE-WINRT-STRING-L1-1-0.DLL The system cannot find the file specified (2). API-MS-WIN-SHCORE-SCALING-L1-1-0.DLL The system cannot find the file specified (2). DCOMP.DLL The system cannot find the file specified (2). GPSVC.DLL The system cannot find the file specified (2). IESHIMS.DLL The system cannot find the file specified (2). ... c:\program files\graphicsmagick-1.3.18-q8\MSVCR90.DLL (Seems to be the wrong CPU version) Error: At least one required implicit or forwarded dependency was not found. Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module. Error: Modules with different CPU types were found. Warning: At least one delay-load dependency module was not found. Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.