I have Python on my Ubuntu system, but gcc can't find Python.h

后端 未结 14 1727
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-27 13:10

I am on a school computer, so I can\'t install anything.

I am trying to create C code which can be run in Python. It seems all the articles I am finding on it requi

相关标签:
14条回答
  • 2020-11-27 13:48

    I found the answer in ubuntuforums (ubuntuforums), you can just add this to your gcc '$(python-config --includes)'

    gcc $(python-config --includes) urfile.c
    
    0 讨论(0)
  • 2020-11-27 13:51

    I ran into the same issue while trying to build a very old copy of omniORB on a CentOS 7 machine. Resolved the issue by installing the python development libraries:

    # yum install python-devel
    

    This installed the Python.h into:

    /usr/include/python2.7/Python.h

    0 讨论(0)
提交回复
热议问题