C++中的嵌入式python:importerror import numpy.core.multiarray
Embedded python in C++: importerror importing numpy.core.multiarray
我正在Visual Studio 2017中开发一个C++程序,该程序应该调用python脚本。我可以在 VS 交互式 python 中导入 numpy,但是在从 main 调用的文件中导入 numpy 时.cpp出现错误
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control). Otherwise reinstall numpy.
我正在使用Python 3.6,numpy 1.12.0,并在x64调试模式下构建main.cpp。我也在使用Cmake来构建。
我已经搜索了很多,但我找不到可行的解决方案。
我改用boost/python.hpp头文件。虽然我在调试模式下构建我的应用程序,但它没有使用 python 的调试版本。numpy 的导入现在正在工作。
相关文章:
- C++返回 Numpy 数组的 Python 扩展模块
- numpy C API 中的import_array如何工作?
- 如何使用C++范围来实现numpy.ndindex?
- 传递 boost::p ython::numpy::ndarray 作为 boost::p ython 函数的(默认或非
- 在 Cython 中将C++向量转换为 numpy 数组,而无需复制
- Boost Python Numpy - 要初始化的未定义引用
- 如何通过 cython 将 numpy 数组列表传递给 C++
- numpy.load 给出 ValueError: descr 不是有效的 dtype 描述符:
- Pybind11 默认参数 numpy 数组或 None
- C++ - 与 Numpy 中的矢量版本相比,Argsort 效率低的矢量版本实现
- 如何使用 CMake 链接"numpy/arrayobject.h"
- 相当于numpy.exexpand_dims()和numpy.contenate()的C++
- Pybind11:在C++中使用Pybind11转换numpy数组的问题
- 在C++中将Import模拟为来自python的功能
- 使用SWIG将numpy数组元素(int)传递给c++int
- 如何在 swig 中使用 numpy.i?
- 如何将 numpy 二维数组作为一种可以用C++读取的二进制格式存储在磁盘上
- Cython:如何在不需要 GIL 的情况下从 numpy 内存视图转到矢量[对[双,双]]?
- 链接问题 boost::p ython::numpy.
- C++中的嵌入式python:importerror import numpy.core.multiarray