首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >aws ubuntu 20.04 mysqlclient无法安装

问aws ubuntu 20.04 mysqlclient无法安装
EN

Stack Overflow用户
提问于 2022-05-30 22:40:34
回答 1查看 252关注 0票数 0

我试着安装mysqlclient,但是它不起作用。

这是错误消息的一部分:

代码语言:javascript
复制
ubuntu@ip-172-31-22-255:~$ sudo pip install mysqlclient
Collecting mysqlclient
  Using cached mysqlclient-2.1.0.tar.gz (87 kB)

Building wheels for collected packages: mysqlclient

  Building wheel for mysqlclient (setup.py) ... error

  ERROR: Command errored out with exit status 1:

   command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-s8p2sg7z/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-s8p2sg7z/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)
(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-0r3vfxv6

       cwd: /tmp/pip-install-s8p2sg7z/mysqlclient/
  Complete output (44 lines):
  mysql_config --version
  ['8.0.29']

  mysql_config --libs
  ['-L/usr/lib/x86_64-linux-gnu', '-lmysqlclient', '-lpthread', '-ldl', '-lz', '-lssl', '-lcrypto', '-lresolv', '-lm', '-lrt']
  mysql_config --cflags

我厌倦了: sudo apt-get install python3 3-dev默认-libmysqlclient构建必需,这是错误消息:

代码语言:javascript
复制
The following packages have unmet dependencies:
 python3-dev : Depends: libpython3-dev (= 3.8.2-0ubuntu2) but it is not going to be installed
               Depends: python3.8-dev (>= 3.8.2-1~) but it is not going to be installed

我试图移除依赖项,但没有任何效果。

EN

回答 1

Stack Overflow用户

发布于 2022-05-31 05:52:02

在安装MySQL客户端之前,您需要在使用pip安装mysql客户机时激活虚拟环境,

https://www.a2hosting.com/kb/developer-corner/mysql/connecting-to-mysql-using-python

此外,请确保您有最新版本的Python。

https://www.a2hosting.com/kb/developer-corner/python/using-a-newer-version-of-python

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72440642

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档