文章详情

短信预约-IT技能 免费直播动态提醒

请输入下面的图形验证码

提交验证

短信预约提醒成功

pip安装mysqlclient报错 Exception: Can not find valid pkg-config name

2023-10-08 16:58

关注

今天docker内搭建python3.10环境时报这个错误,安装 mysqlclient 时报错。

WARNING: The directory '/home/seluser/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.Collecting mysqlclient  Downloading mysqlclient-2.2.0.tar.gz (89 kB)     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 89.5/89.5 KB 114.5 kB/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  ╰─> [22 lines of output]      Trying pkg-config --exists mysqlclient      Command 'pkg-config --exists mysqlclient' returned non-zero exit status 1.      Trying pkg-config --exists mariadb      Command 'pkg-config --exists mariadb' returned non-zero exit status 1.      Traceback (most recent call last):        File "/home/seluser/.pyenv/versions/3.10.3/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in           main()        File "/home/seluser/.pyenv/versions/3.10.3/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/seluser/.pyenv/versions/3.10.3/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-wke_e7h4/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel          return self._get_build_requires(config_settings, requirements=['wheel'])        File "/tmp/pip-build-env-wke_e7h4/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires          self.run_setup()        File "/tmp/pip-build-env-wke_e7h4/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 341, in run_setup          exec(code, locals())        File "", line 154, in         File "", line 48, in get_config_posix        File "", line 27, in find_package_name      Exception: Can not find valid pkg-config name.      Specify MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LDFLAGS env vars manually      [end of output]    note: This error originates from a subprocess, and is likely not a problem with pip.error: subprocess-exited-with-error

找了半天找不到为什么,

最后网上搜索到一个命令:

apt-get install libmysqlclient-dev

先安装了这个后,再安装就没问题了。

话说docker安装python环境是真的扯淡

来源地址:https://blog.csdn.net/jioulongzi/article/details/132746506

阅读原文内容投诉

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

软考中级精品资料免费领

  • 历年真题答案解析
  • 备考技巧名师总结
  • 高频考点精准押题
  • 2024年上半年信息系统项目管理师第二批次真题及答案解析(完整版)

    难度     813人已做
    查看
  • 【考后总结】2024年5月26日信息系统项目管理师第2批次考情分析

    难度     354人已做
    查看
  • 【考后总结】2024年5月25日信息系统项目管理师第1批次考情分析

    难度     318人已做
    查看
  • 2024年上半年软考高项第一、二批次真题考点汇总(完整版)

    难度     435人已做
    查看
  • 2024年上半年系统架构设计师考试综合知识真题

    难度     224人已做
    查看

相关文章

发现更多好内容

猜你喜欢

AI推送时光机
位置:首页-资讯-数据库
咦!没有更多了?去看看其它编程学习网 内容吧
首页课程
资料下载
问答资讯