programing

치명적 오류: mysql.h: mariadb를 설치할 때 해당 파일 또는 디렉토리가 없습니다.

i4 2023. 7. 5. 20:06
반응형

치명적 오류: mysql.h: mariadb를 설치할 때 해당 파일 또는 디렉토리가 없습니다.

설치하려고 했습니다.mariadb==1.0.4하지만 그것은 매번 실패합니다../include/mariadb_python.h:27:19: fatal error: mysql.h: No such file or directory

추적을 아래와 같이 쌓습니다.

    Running setup.py install for mariadb ... error
    ERROR: Command errored out with exit status 1:
     command: /home/s/dbSync/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6v5t56ge/mariadb/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6v5t56ge/mariadb/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-ju1qda35/install-record.txt --single-version-externally-managed --compile --install-headers /home/s/dbSync/include/site/python3.7/mariadb
         cwd: /tmp/pip-install-6v5t56ge/mariadb/
    Complete output (23 lines):
    10.4.3
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.7
    creating build/lib.linux-x86_64-3.7/mariadb
    copying mariadb/__init__.py -> build/lib.linux-x86_64-3.7/mariadb
    creating build/lib.linux-x86_64-3.7/mariadb/constants
    copying mariadb/constants/__init__.py -> build/lib.linux-x86_64-3.7/mariadb/constants
    copying mariadb/constants/CLIENT.py -> build/lib.linux-x86_64-3.7/mariadb/constants
    copying mariadb/constants/INDICATOR.py -> build/lib.linux-x86_64-3.7/mariadb/constants
    copying mariadb/constants/CURSOR.py -> build/lib.linux-x86_64-3.7/mariadb/constants
    copying mariadb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.7/mariadb/constants
    running build_ext
    building 'mariadb._mariadb' extension
    creating build/temp.linux-x86_64-3.7
    creating build/temp.linux-x86_64-3.7/mariadb
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPY_MARIADB_MAJOR_VERSION=1 -DPY_MARIADB_MINOR_VERSION=0 -DPY_MARIADB_PATCH_VERSION=4 -I/usr/local/include/mariadb -I/usr/local/include/mariadb/mysql -I./include -I/home/s/dbSync/include -I/usr/include/python3.7m -c mariadb/mariadb.c -o build/temp.linux-x86_64-3.7/mariadb/mariadb.o -DDEFAULT_PLUGINS_SUBDIR="/usr/local/lib/mariadb/plugin"
    In file included from mariadb/mariadb.c:21:0:
    ./include/mariadb_python.h:27:19: fatal error: mysql.h: No such file or directory
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/s/dbSync/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6v5t56ge/mariadb/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6v5t56ge/mariadb/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-ju1qda35/install-record.txt --single-version-externally-managed --compile --install-headers /home/s/dbSync/include/site/python3.7/mariadb Check the logs for full command output.

내가 할 때locate mysql.h나는 파일이 있는 것을 볼 수 있습니다./usr/include/mysql/mysql.h

환경 세부 정보:

Running on Virtual env 
 pip3
 ubuntu 16.04
 Python 3.7.9
 x86_64

처음에는 이것이 이 사건과 관련이 있다고 가정했습니다.$PATH하지만 추가한 후에도./usr/include/동작되지 않습니다.

pip3 동결

certifi==2020.6.20
chardet==3.0.4
idna==2.10
mysqlclient==2.0.1
pypyodbc==1.3.4
requests==2.25.0
urllib3==1.26.2

libmysqlclient-dev이미 최신 버전입니다.

libmariadb-dev를 설치해야 합니다.

sudo apt install libmariadb-dev

설치를 다시 시도합니다.mariadb꾸러미

언급URL : https://stackoverflow.com/questions/65017854/fatal-error-mysql-h-no-such-file-or-directory-when-installing-mariadb

반응형