반응형
해결
apt install libmariadb-dev
원인은 필요한게 없어서 그런건데 오류를 보면 보다시피 mariadb_config가 없다고 한다.
그래서 관련 라이브러리를 install 해준다.
Build prerequisites
The following build prerequisites are required to install or build MariaDB Connector/Python from source code, github or from pypi.org.
To install MariaDB Connector/Python from sources you will need:
- C compiler
- Python development files (Usually they are installed with package python3-dev). The minimum supported version of Python is 3.7.
- MariaDB Connector/C libraries and header files (Either from MariaDB server package or from MariaDB Connector/C package). Minimum required version for MariaDB Connector/Python < 1.1.0 is 3.1.5, for later versions 3.2.4. If your distribution doesn’t provide a recent version of MariaDB Connector/C you can either download binary packages from MariaDB Connector Download page or build the package from source.
- The mariadb_config program from MariaDB Connector/C, which should be in your PATH directory.
- For Posix systems: TLS libraries, e.g. GnuTLS or OpenSSL (default)
- Since MariaDB Connector/Python 1.1.5: Python’s “packaging” module.
On Posix systems make sure that the path environment variable contains the directory which contains the mariadb_config utility.
Once everything is in place, run
pip3 install mariadb
https://int-i.github.io/python/2021-03-01/mariadb-config-not-found/
https://mariadb-corporation.github.io/mariadb-connector-python/install.html#build-prerequisites
error
pip install mariadb
Collecting mariadb
Downloading mariadb-1.1.5.post3.tar.gz (82 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 82.2/82.2 KB 3.6 MB/s eta 0:00:00
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/works/test/.venv/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
main()
File "/home/works/test/.venv/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/works/test/.venv/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-rbkialob/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "/tmp/pip-build-env-rbkialob/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-rbkialob/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 484, in run_setup
super(_BuildMetaLegacyBackend,
File "/tmp/pip-build-env-rbkialob/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 335, in run_setup
exec(code, locals())
File "<string>", line 27, in <module>
File "/tmp/pip-install-xhwihjxw/mariadb_b8087447611e48efae6c751c3946a983/mariadb_posix.py", line 62, in get_config
cc_version = mariadb_config(config_prg, "cc_version")
File "/tmp/pip-install-xhwihjxw/mariadb_b8087447611e48efae6c751c3946a983/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.
다른 에러
https://24hours-beginner.tistory.com/447
https://24hours-beginner.tistory.com/450
반응형
'Python' 카테고리의 다른 글
[Python] python3 -m venv .venv error (feat. ubuntu) (0) | 2023.03.07 |
---|---|
[PYTHON] DB SSL 연결 (feat. sql alchemy / mariadb) (0) | 2023.01.20 |
[SQLAlchemy] shema 사용하기 (0) | 2023.01.03 |
[Python] Python Timezone conversion (feat. pytz replace & timezone) (0) | 2023.01.02 |
[Python] Sqlalchemy mysql group by with rollup (0) | 2022.09.01 |