gpt4 book ai didi

Python3 - Pipenv 安装 mysqlclient?

转载 作者:行者123 更新时间:2023-12-04 18:32:55 26 4
gpt4 key购买 nike

尝试从 pipenv 安装:

pipenv install mysqlclient

将导致:

Installing mysqlclient… Collecting mysqlclient Using cached https://files.pythonhosted.org/packages/6f/86/bad31f1c1bb0cc99e88ca2adb7cb5c71f7a6540c1bb001480513de76a931/mysqlclient-1.3.12.tar.gz Complete output from command python setup.py egg_info: /bin/sh: 1: mysql_config: not found Traceback (most recent call last): File "", line 1, in File "/tmp/pip-install-5vhtqgve/mysqlclient/setup.py", line 17, in metadata, options = get_config() File "/tmp/pip-install-5vhtqgve/mysqlclient/setup_posix.py", line 44, in get_config libs = mysql_config("libs_r") File "/tmp/pip-install-5vhtqgve/mysqlclient/setup_posix.py", line 26, in mysql_config raise EnvironmentError("%s not found" % (mysql_config.path,)) OSError: mysql_config not found

----------------------------------------

Error: An error occurred while installing mysqlclient! Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-5vhtqgve/mysqlclient/

This is likely caused by a bug in mysqlclient. Report this to its maintainers.



我正在使用 Debian 和另一个 virtualenv 它得到系统包
python-mysqldb/testing,now 1.3.10-1 amd64 

Pipenv 不会使用这个,也不会安装另一个。
我该如何解决这个问题?
谢谢,BR

最佳答案

您可能需要操作系统的 mysql 客户端库。

sudo apt install libmysqlclient-dev

然后你应该能够:
pipenv install mysqlclient

关于Python3 - Pipenv 安装 mysqlclient?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72695417/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com