본문 바로가기

트러블슈팅

DDS2M 디노이징 실행시 에러 fatal error: Python.h: No such file or directory

DDS2M 디노이징 연구 중 에러 발생하였습니다.
fatal error: Python.h: No such file or directory 12
| #include <Python.h> | ^~~~~~~~~~ compilation terminated. error: command '/usr/bin/x86_64-linux-gnu-g++' failed with exit code 1
 
이 에러는 C 또는 C++ 확장을 컴파일하거나 파이썬 관련 라이브러리를 설치할 때, Python 헤더 파일(Python.h)이 없는 경우 발생함.
 Python.h는 Python 개발 도구(Development Tools)에 포함되어 있으며, 이를 설치해야 문제를 해결할 수 있음.

sudo apt-get update

sudo apt-get install python3-dev  # Python 3.x용
sudo apt-get install python3.9-dev
sudo apt-get update
sudo apt-get install python3-dev  # Python 3.x용
sudo apt-get install python3.9-dev

 

g++ 컴파일러가 설치되어 있어야함.

sudo apt-get install build-essential