iis服务器助手广告广告
返回顶部
首页 > 资讯 > 数据库 >pip安装mysqlclient报错 Exception: Can not find valid pkg-config name
  • 957
分享到

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

pip 2023-10-08 16:10:17 957人浏览 安东尼
摘要

今天Docker内搭建python3.10环境时报这个错误,安装 Mysqlclient 时报错。 WARNING: The directory '/home/seluser/.cache/pip'

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

您可能感兴趣的文档:

--结束END--

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

本文链接: https://www.lsjlt.com/news/425418.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

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

下载Word文档
猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作