我的编程空间,编程开发者的网络收藏夹
学习永远不晚

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

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

北京

  • 北京
  • 上海
  • 天津
  • 重庆
  • 河北
  • 山东
  • 辽宁
  • 黑龙江
  • 吉林
  • 甘肃
  • 青海
  • 河南
  • 江苏
  • 湖北
  • 湖南
  • 江西
  • 浙江
  • 广东
  • 云南
  • 福建
  • 海南
  • 山西
  • 四川
  • 陕西
  • 贵州
  • 安徽
  • 广西
  • 内蒙
  • 西藏
  • 新疆
  • 宁夏
  • 兵团
手机号立即预约

请填写图片验证码后获取短信验证码

看不清楚,换张图片

免费获取短信验证码

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

今天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

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

下载Word文档到电脑,方便收藏和打印~

下载Word文档

编程热搜

目录