본문 바로가기

Python

[python] pip install mariadb - E: Package 'python-dev' has no installation candidate (feat. ubuntu)

반응형

Error

  Downloading mariadb-1.0.3.tar.gz (66 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 66.6/66.6 KB 4.8 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Skipping wheel build for mariadb, due to binaries being disabled for it.
Installing collected packages: mariadb
  Running setup.py install for mariadb ... error
  error: subprocess-exited-with-error

  × Running setup.py install for mariadb did not run successfully.
  │ exit code: 1
  ╰─> [21 lines of output]
      running install
      /home/edgefarm_direct_api/.venv/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other
standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.10
      creating build/lib.linux-x86_64-3.10/mariadb
      copying mariadb/__init__.py -> build/lib.linux-x86_64-3.10/mariadb
      creating build/lib.linux-x86_64-3.10/mariadb/constants
      copying mariadb/constants/__init__.py -> build/lib.linux-x86_64-3.10/mariadb/constants
      copying mariadb/constants/CLIENT.py -> build/lib.linux-x86_64-3.10/mariadb/constants
      copying mariadb/constants/INDICATOR.py -> build/lib.linux-x86_64-3.10/mariadb/constants
      copying mariadb/constants/CURSOR.py -> build/lib.linux-x86_64-3.10/mariadb/constants
      copying mariadb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.10/mariadb/constants
      running build_ext
      building 'mariadb._mariadb' extension
      creating build/temp.linux-x86_64-3.10
      creating build/temp.linux-x86_64-3.10/mariadb
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -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=3 -I/usr/include/mariadb -I/usr/include/mariadb/mysql -I./include -I/home/edgefarm_direct_api/.venv/include -I/usr/include/python3.10 -c mariadb/mariadb.c -o build/temp.linux-x86_64-3.10/mariadb/mariadb.o -DDEFAULT_PLUGINS_SUBDIR="/usr/lib/x86_64-linux-gnu/libmariadb3/plugin"
      error: command 'x86_64-linux-gnu-gcc' failed: No such file or directory
      [end of output]

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

× Encountered error while trying to install package.
╰─> mariadb

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
(.venv) root@ubuntu:/home/edgefarm_direct_api# apt install python-dev gcc
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package python-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  python2-dev python2 python-dev-is-python3

E: Package 'python-dev' has no installation candidate

해결

apt install python3-dev gcc

 

다른에러

https://24hours-beginner.tistory.com/423

 

[Python] pip install mariadb - Python: OSError: mariadb_config not found. (feat. ubuntu)

해결 apt install libmariadb-dev 원인은 필요한게 없어서 그런건데 오류를 보면 보다시피 mariadb_config가 없다고 한다. 그래서 관련 라이브러리를 install 해준다. Build prerequisites The following build prerequisites a

24hours-beginner.tistory.com

https://24hours-beginner.tistory.com/447

 

[Python] pip install mariadb - MariaDB Connector/Python requires MariaDB Connector/C >= 3.3.1, found version 3.1.20 (feat. ubunt

관련에러 [Python] pip install mariadb - Python: OSError: mariadb_config not found. (feat. ubuntu) [Python] pip install mariadb - Python: OSError: mariadb_config not found. (feat. ubuntu) 해결 apt install libmariadb-dev 원인은 필요한게 없어

24hours-beginner.tistory.com

 

반응형