【问题标题】:Error when embed python script in C in VS2017在VS2017中将python脚本嵌入C时出错
【发布时间】:2019-07-11 19:21:49
【问题描述】:

我写了一个简单的C代码来嵌入python脚本,但是当我在VS2017中运行它时,它看起来很好,直到返回。它表明错误发生在exe_common.inl中。但是,我找不到错误的地方。

#include <stdio.h>
#include <stdlib.h>
#include <Python.h>

int main()
{
    Py_Initialize();

    PyRun_SimpleString("print('Hello world!')");

    Py_Finalize();

    //system("pause");
    return 0;
}

【问题讨论】:

    标签: python c embed


    【解决方案1】:

    我尝试使用代码块 17.12 运行它,它给了我一个错误提示 “致命错误:Python.h:没有这样的文件或目录”

    我认为没有像“”这样的内置头文件

    【讨论】:

    • 你应该在你的ide中配置python路径,就像配置第三方库一样。
    猜你喜欢
    • 2019-05-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多