개발/Python

python pip install mariadb error => mariadb_config: not found

강서버 2024. 4. 23. 18:28
반응형

[ Error Log ]

 

$ pip install mariadb
Defaulting to user installation because normal site-packages is not writeable
Collecting mariadb
  Using cached mariadb-1.1.10.tar.gz (84 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [30 lines of output]
      /bin/sh: 1: mariadb_config: not found
      Traceback (most recent call last):
        File "/home/gangserver/.local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/gangserver/.local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/gangserver/.local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-jpja06q7/overlay/local/lib/python3.10/dist-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/tmp/pip-build-env-jpja06q7/overlay/local/lib/python3.10/dist-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-jpja06q7/overlay/local/lib/python3.10/dist-packages/setuptools/build_meta.py", line 487, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-jpja06q7/overlay/local/lib/python3.10/dist-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 27, in <module>
        File "/tmp/pip-install-ycnv8z_4/mariadb_ccf2c3b423424715b527f4e7da260f16/mariadb_posix.py", line 62, in get_config
          cc_version = mariadb_config(config_prg, "cc_version")
        File "/tmp/pip-install-ycnv8z_4/mariadb_ccf2c3b423424715b527f4e7da260f16/mariadb_posix.py", line 28, in mariadb_config
          raise EnvironmentError(
      OSError: mariadb_config not found.
      
      This error typically indicates that MariaDB Connector/C, a dependency which
      must be preinstalled, is not found.
      If MariaDB Connector/C is not installed, see installation instructions
      If MariaDB Connector/C is installed, either set the environment variable
      MARIADB_CONFIG or edit the configuration file 'site.cfg' to set the
       'mariadb_config' option to the file location of the mariadb_config utility.
      
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

 

 

[ Solution ]

libmariadb-dev apt install

 

$ sudo apt install libmariadb-dev
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다... 완료
상태 정보를 읽는 중입니다... 완료        
다음의 추가 패키지가 설치될 것입니다 :
  libssl-dev
제안하는 패키지:
  libssl-doc
다음 새 패키지를 설치할 것입니다:
  libmariadb-dev libssl-dev
0개 업그레이드, 2개 새로 설치, 0개 제거 및 0개 업그레이드 안 함.
2,570 k바이트 아카이브를 받아야 합니다.
이 작업 후 13.2 M바이트의 디스크 공간을 더 사용하게 됩니다.
계속 하시겠습니까? [Y/n] y
(... Log omitted ...)

 

 

$ pip install mariadb
Defaulting to user installation because normal site-packages is not writeable
Collecting mariadb
  Using cached mariadb-1.1.10.tar.gz (84 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: packaging in ./.local/lib/python3.10/site-packages (from mariadb) (24.0)
Building wheels for collected packages: mariadb
  Building wheel for mariadb (pyproject.toml) ... done
  Created wheel for mariadb: filename=mariadb-1.1.10-cp310-cp310-linux_x86_64.whl size=189281 sha256=2349c8dd6b055b89f92e541ea72abd3a558624f98525af2739ceb5dee462563a
  Stored in directory: /home/gangserver/.cache/pip/wheels/1c/6f/a0/e9b659eb68c1011f6311b8513dee785c5b2efc48919310783a
Successfully built mariadb
Installing collected packages: mariadb
Successfully installed mariadb-1.1.10

 

 

728x90
반응형