【发布时间】:2021-10-28 16:18:53
【问题描述】:
我的部分项目需要 MySQL-python 包。 我正在运行 Linux Mint 20,内核 5.11 到目前为止,我的一切工作正常。只需设置我的虚拟环境,所有软件包都通过诗歌安装,除了 MySQL-python。它失败了:
fatal error: my_config.h: No such file or directory
44 | #include "my_config.h"
| ^~~~~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/matt/git/proj/test/python/.venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-f_UUOG/mysql-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-f_UUOG/mysql-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-XzgEIa/install-record.txt --single-version-externally-managed --compile --install-headers /home/matt/git/proj/test/python/.venv/include/site/python2.7/mysql-python Check the logs for full command output.
我尝试将my_config_h 文件夹添加到/usr/local/mysql and /home/linuxbrew/.linuxbrew/Cellar/mysql/8.0.26(自动设置)。不知道如何解决这个问题。
我有 export PATH=${PATH}:/usr/local/mysql/bin 我的 bash 配置。
我尝试使用 brew 链接/取消链接 mysql。
是否有很多谷歌搜索和对其他人有用的解决方案对我不起作用。
提前致谢。
编辑:解决了一堆小错误后,现在的问题是
/home/linuxbrew/.linuxbrew/bin/ld: cannot find -lzstd
这些是我相信在 usr/bin 和上述目录中的软件包。
这里是更多的错误输出:
/home/linuxbrew/.linuxbrew/bin/ld: cannot find -lzstd
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1```
【问题讨论】:
-
mysqlclientpip 包是一个替代品。pip install mysqlclient -
这会引发以下错误:
/home/linuxbrew/.linuxbrew/bin/ld: cannot find -lzstd collect2: error: ld returned 1 exit status error: command 'x86_64-linux-gnu-gcc' failed with exit status 1