简体   繁体   English

Boost.Python示例,Windows 7 x64,“ ImportError:DLL加载失败:找不到指定的模块。”

[英]Boost.Python examples, Windows 7 x64, “ImportError: DLL load failed: The specified module could not be found.”

I've spent last 2 days trying to launch examples from Boost.Python with the "ImportError: DLL load failed: The specified module could not be found" error, while trying to load compiled (using bjam) pyd modules. 我花了两天的时间尝试从Boost.Python启动带有“导入错误:DLL加载失败:找不到指定的模块”错误的示例,同时尝试加载已编译(使用bjam)的pyd模块。 I was using Windows 7 x64, Python 2.7 x64 with Boost 1.47. 我使用的是Windows 7 x64,Python 2.7 x64和Boost 1.47。 I've followed up different answers on StackOverflow and other sites incl. 我已经在StackOverflow和其他网站上追踪了不同的答案。 fresh installs (Python 32 and 64 bit, Boost precompiled), manual Boost's libraries building, DLL checks with dependency walker and so on, with no luck. 全新安装(Python 32和64位,Boost预编译),手动Boost的库构建,带有依赖项遍历器的DLL检查等等,没有运气。 I registered to share the solution, which worked here and which I hope may help someone, struggling with the same error ;) 我注册分享了解决方案,该解决方案在这里有效,希望对遇到同样错误的人有所帮助;)

Two solution, no need to use regedit 两种解决方案,无需使用regedit

  1. add BOOST_PYTHON_STATIC_LIB marco when build your dll. 建立dll时加入BOOST_PYTHON_STATIC_LIB marco。 It will let boost.python static link to your dll file rather than dynamic load in runtime. 它将使boost.python静态链接到您的dll文件,而不是在运行时动态加载。
  2. add boost.python dll to PATH or copy it to same dir where your dll locate 将boost.python dll添加到PATH或将其复制到dll所在的相同目录

The problem was with the KB2264107 Windows update (http://support.microsoft.com/kb/2264107), "messing" with DLL search routine (security fix). 问题出在Windows更新KB2264107(http://support.microsoft.com/kb/2264107)上,带有DLL搜索例程的“消息”(安全修补程序)。 Setting the registry value [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager] : CWDIllegalInDllSearch to 0, allowed to properly load DLL files and properly import .pyd modules. 将注册表值[HKEY_LOCAL_MACHINE \\ SYSTEM \\ CurrentControlSet \\ Control \\ Session Manager]设置为:CWDIllegalInDllSearch设置为0,可以正确加载DLL文件并正确导入.pyd模块。 This may also happen on other Windows versions. 在其他Windows版本上也可能会发生这种情况。

我的解决方案是下载Microsoft Visual C ++ 2015重新分发 https://www.microsoft.com/zh-cn/download/details.aspx?id=48145

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Boost.Python + opencv Error, Windows 10 x64, "ImportError: DLL load failed: The specified module could not be found." - Boost.Python + opencv Error, Windows 10 x64, "ImportError: DLL load failed: The specified module could not be found." python Windows“ ImportError:DLL加载失败:找不到指定的模块。”加载编译的扩展名时 - python Windows “ImportError: DLL load failed: The specified module could not be found.” When loading compiled extension 导入错误:DLL 加载失败:找不到指定的模块。(Keras) - ImportError: DLL load failed: The specified module could not be found.(Keras) MeCab:“ImportError:DLL 加载失败:找不到指定的模块。” - MeCab: “ImportError: DLL load failed: The specified module could not be found.” MeCab:“ ImportError:DLL加载失败:找不到指定的模块。” - MeCab: “ImportError: DLL load failed: The specified module could not be found.” ImportError:DLL加载失败:找不到指定的过程。蟒蛇 - ImportError: DLL load failed: The specified procedure could not be found. Python 导入错误:DLL 加载失败:找不到指定的模块。 (NASA Fortran CEA 的 Python Rocketcea 包装器) - ImportError: DLL load failed: The specified module could not be found. (Python rocketcea wrapper for NASA Fortran CEA) 导入错误:DLL 加载失败:找不到指定的模块。 Python 3.6 导入 dotnet - ImportError: DLL load failed: The specified module could not be found. Python 3.6 import dotnet Windows 上的 Tensorflow - ImportError:DLL 加载失败:找不到指定的模块 - Tensorflow on windows - ImportError: DLL load failed: The specified module could not be found Windows,ImportError:DLL加载失败:找不到指定的模块 - windows, ImportError: DLL load failed: The specified module could not be found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM