Question / Help OBS 23.1.0 fails to Install on Debian 9 Testing/Buster Fatal error: Python.h: No such file or directory

dannysupernova

New Member
Update: I was able to install OBS 23.0.2 just fine. This only happens on OBS 23.1.0.

So long story short, my HDD died yesterday, and my OS was installed on it. I had OBS running just fine on Debian 9 only a few days ago. I don't recall what version OBS (sorry). So I got a new SSD today, and installed Debian 9 Stable/Stretch. OBS would not install, so I decided to try Debian 9 Testing/Buster. Still nothing. Here's what I'm getting during make -j4 step.

Code:
~/obs-studio/build$ make -j4
[ 24%] Built target obspython_swig_compilation
[ 24%] Built target media-playback
[ 24%] Built target glad
[ 24%] Built target obslua_swig_compilation
[ 24%] Built target libobs
[ 24%] Built target obs-ffmpeg-mux
[ 24%] Built target file-updater
[ 24%] Built target obs-frontend-api
[ 24%] Built target libobs-opengl
[ 24%] Built target linux-capture
[ 24%] Built target linux-pulseaudio
[ 24%] Built target linux-jack
[ 24%] Built target linux-v4l2
[ 24%] Built target linux-alsa
[ 24%] Built target linux-decklink
[ 24%] Built target vlc-video
[ 24%] Built target image-source
[ 24%] Built target obs-x264
[ 24%] Built target obs-libfdk
[ 24%] Built target obs-ffmpeg
[ 24%] Built target obs-outputs
[ 24%] Built target obs-filters
[ 24%] Built target obs-transitions
[ 24%] Built target text-freetype2
[ 24%] Automatic MOC for target obs
[ 24%] Built target rtmp-services
[ 24%] Automatic MOC for target decklink-ouput-ui
[ 24%] Building C object deps/obs-scripting/CMakeFiles/obs-scripting.dir/obs-scripting-python-frontend.c.o
[ 24%] Building C object deps/obs-scripting/CMakeFiles/obs-scripting.dir/obs-scripting-python.c.o
In file included from /home/daniel/obs-studio/deps/obs-scripting/obs-scripting-python.h:31,
                 from /home/daniel/obs-studio/deps/obs-scripting/obs-scripting-python.c:19:
/home/daniel/obs-studio/deps/obs-scripting/obs-scripting-python-import.h:39:11: fatal error: Python.h: No such file or directory
# include <Python.h>
           ^~~~~~~~~~
compilation terminated.
[ 24%] Built target decklink-ouput-ui_autogen
make[2]: *** [deps/obs-scripting/CMakeFiles/obs-scripting.dir/build.make:110: deps/obs-scripting/CMakeFiles/obs-scripting.dir/obs-scripting-python.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 24%] Built target obs_autogen
[ 24%] Building C object deps/obs-scripting/CMakeFiles/obs-scripting.dir/obs-scripting-lua.c.o
In file included from /home/daniel/obs-studio/deps/obs-scripting/obs-scripting-python.h:31,
                 from /home/daniel/obs-studio/deps/obs-scripting/obs-scripting-python-frontend.c:21:
/home/daniel/obs-studio/deps/obs-scripting/obs-scripting-python-import.h:39:11: fatal error: Python.h: No such file or directory
# include <Python.h>
           ^~~~~~~~~~
compilation terminated.
make[2]: *** [deps/obs-scripting/CMakeFiles/obs-scripting.dir/build.make:123: deps/obs-scripting/CMakeFiles/obs-scripting.dir/obs-scripting-python-frontend.c.o] Error 1
In file included from /home/daniel/obs-studio/deps/obs-scripting/obs-scripting-lua.c:18:
/home/daniel/obs-studio/deps/obs-scripting/obs-scripting-lua.h:22:10: fatal error: lua.h: No such file or directory
#include <lua.h>
          ^~~~~~~
compilation terminated.
make[2]: *** [deps/obs-scripting/CMakeFiles/obs-scripting.dir/build.make:136: deps/obs-scripting/CMakeFiles/obs-scripting.dir/obs-scripting-lua.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:331: deps/obs-scripting/CMakeFiles/obs-scripting.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 24%] Built target decklink-ouput-ui
[ 24%] Built target obs
make: *** [Makefile:152: all] Error 2

I have python3-dev installed, and it's version 7. Perhaps I'm missing a symlink somewhere? I know I've had to create symlinks for stuff for OBS before, but this error is a bit more cryptic for me. Any help would be appreciated. Thanks in advance.
 
Last edited:

berkninan

New Member
Python.h: No such file or directory # include <Python.h>

Most of the time these are dependency-issues. Python.h is used by GNU Compiler Collection (gcc) to build applications. You need to install a package called python-dev for building Python modules, extending the Python interpreter or embedding Python in applications. You encounter "Python.h: No such file or directory" error while trying to build a shared library using the file extension of another language ( e.g. 'C' ). If you are trying to build a shared library using the file extension of another language, you need to install the correct development version of Python.

Reason for this error:

  • You haven't properly installed the header files and static libraries for python dev.
  • Also, sometimes include files might not be default in the include path.

How to solve this error:

  • Install the missing files and libraries.
  • Include Path and Library.
  • Finally, Compile it.
 
Top