Problem with pip install mariadb - mariadb_config not found(pip install mariadb 的问题 - mariadb_config 未找到)
问题描述
我一直在尝试在运行 ubuntu 18.04 的树莓派上运行 pip3 install mariadb
,但没有成功.
I have been trying to run pip3 install mariadb
on my raspberry pi running ubuntu 18.04 and I was unsuccessful.
我已尝试按照其他答案中的建议安装以下软件包:
I have tried installing following packages as suggested in other answers:
sudo apt-get install mariadb-server
sudo apt-get install libmariadbclient-dev
sudo apt-get install libmysqlclient-dev
pip3 install mysqlclient
pip3 install mysql-connector-python-rf
但是,我仍然遇到如图所示的问题:
However, I'm still running intto the problem as shown:
ubuntu@ubuntu:~$ pip3 install mariadb
Collecting mariadb
Using cached https://files.pythonhosted.org/packages/8f/c9/7050899dc1066409a17e1147d3afe1b078e582afdb755c6d3cb9c9a5c3ab/mariadb-1.0.0.tar.gz
Complete output from command python setup.py egg_info:
/bin/sh: 1: mariadb_config: not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-2gdw_t_r/mariadb/setup.py", line 26, in <module>
cfg = get_config(options)
File "/tmp/pip-build-2gdw_t_r/mariadb/mariadb_posix.py", line 49, in get_config
cc_version = mariadb_config(config_prg, "cc_version")
File "/tmp/pip-build-2gdw_t_r/mariadb/mariadb_posix.py", line 27, in mariadb_config
"mariadb_config not found.
Please make sure, that MariaDB Connector/C is installed on your system, edit the configuration file 'site.cfg' and set the 'mariadb_config'
option, which should point to the mariadb_config utility.")
OSError: mariadb_config not found.
Please make sure, that MariaDB Connector/C is installed on your system, edit the configuration file 'site.cfg' and set the 'mariadb_config'
option, which should point to the mariadb_config utility.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-2gdw_t_r/mariadb/
我确实有 /etc/mysql/my.cnf
文件.
推荐答案
看来是你没有正确安装MariaDB Connector/C,Ubuntu上的mariadb_config应该在/usr/bin下.
It looks like that you didn't install MariaDB Connector/C properly, on Ubuntu mariadb_config should be found in /usr/bin.
另请注意,MariaDB Connector/Python 需要 MariaDB Connector/C 3.1.5 或更高版本,afaik Ubuntu 18.04 提供 3.0.3 - 所以最简单的方法是下载 Connector/C 源代码并手动构建.
Please also note, that MariaDB Connector/Python requires MariaDB Connector/C 3.1.5 or newer, afaik Ubuntu 18.04 provides 3.0.3 - so simplest way would be to download the Connector/C sources and build it manually.
这篇关于pip install mariadb 的问题 - mariadb_config 未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:pip install mariadb 的问题 - mariadb_config 未找到
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 更改自动增量起始编号? 2021-01-01
- SQL 临时表问题 2022-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01