Python 3.8 不能与 Pybind11 一起导入 [Windows]
python 3.8 can't be imported with pybind11 [windows]
我正在使用pybind11在C++开发python库。问题是python 3.7/3.6运行良好,但是 无法导入 Python 3.8。这是导入库时的错误(假设库名称为 mylibrary(。
ImportError: DLL load failed while importing mylibrary: The specified module could not be found.
为什么 Python3.8 可以在 pybind11 中构建,但不能导入?
可能是你的C++ python 库本身依赖于共享库/DLL。Python 3.7/3.6 会在 PATH 或当前工作目录中搜索 DLL,但在 Python 3.8 中不再如此:
https://docs.python.org/3.8/whatsnew/3.8.html#ctypes
如果这是问题所在,您可以添加 using add_dll_directory(( 告诉 Python 3.8 应该在哪里查找 DLL。
相关文章:
- 在VS代码中交叉编译Windows与Linux上的MinGW的SDL程序
- 在Linux for Windows上编译C++代码时出错
- 尝试导入pybind-opencv模块时出现libgtk错误
- 在Windows上用C++裁剪HBITMAP
- C++ Windows 驱动程序MSB3030无法复制该文件,因为它找不到
- 如何加载(或映射)文件部分的最大大小,但适合在Windows上的RAM
- std::threads可以从Windows DLL中的全局变量创建/销毁吗?
- 导入库可以跨dll版本工作吗
- Python 3.8 不能与 Pybind11 一起导入 [Windows]
- 如何链接 DLL 以供 LoadLibrary() 使用(在 Windows 上的 C++ 中)并从调用 exe 导入变
- 如何在Windows窗体应用程序中打开txt文件并将行导入文本框
- Windows 服务导入C++非托管代码
- OpenCV导入在Windows容器中失败(在Windows Server 2016上)
- 如何在Windows表单应用程序vc ++中导入C静态库
- 使用CNG存储功能导入Windows密钥存储中的持久键
- 将 GNU/Linux C++ 包导入 Windows 上的 Visual Studio
- 无法将Visual Studio制作的c++ DLL导入到Windows上的Visual Studio c#项目中
- DLL导入(在windows上导入动态DLL库)
- 将c++库导入c# (Windows Phone)
- Visual Studio - 如何在没有导入表的情况下编译C++ Windows exe