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

后端 未结 14 1798
爱一瞬间的悲伤
爱一瞬间的悲伤 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:36

    locate Python.h
    

    If the output is empty, then find your python version

    python --version
    

    lets say it is X.x i.e 2.7 or 3.6, 3.7, 3.8 Then with the same version install header files and static libraries for python

    sudo apt-get install pythonX.x-dev
    
    

提交回复
热议问题