pip3安装mysql

编程入门 行业动态 更新时间:2024-10-25 04:26:00
本文介绍了pip3安装mysql-python失败,错误代码为/tmp/pip-install-4nev4id4/mysql-python/的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

当我尝试通过输入来安装mysql-python时,我是烧瓶上的python的新手. 在终端

I am new in python on flask, when i try to install mysql-python by entering the following command in terminal

pip3 install mysql-python

它显示以下错误:

Collecting mysql-python Using cached files.pythonhosted/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-install-4nev4id4/mysql-python/setup.py", line 13, in <module> from setup_posix import get_config File "/tmp/pip-install-4nev4id4/mysql-python/setup_posix.py", line 2, in <module> from ConfigParser import SafeConfigParser ModuleNotFoundError: No module named 'ConfigParser' ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-4nev4id4/mysql-python/

然后我使用此命令 我在stackoverflow上检查过的很多建议都显示了终端中的sudo apt install default-libmysqlclient-dev.

and then I use this command sudo apt install default-libmysqlclient-dev in terminal which has been suggested by many i checked on stackoverflow.

然后我重试安装mysql-python,但它也显示相同的错误,有人可以帮助我吗.

and then I retry to install mysql-python but also it is showing the same error, can anyone please help me.

推荐答案

mysql-python 仅支持Python 2.x,而您似乎正在使用Python3.在链接的PyPI页面中:

mysql-python only supports Python 2.x, while you seem to be using Python 3. From the linked PyPI page:

MySQL-3.23至5.5和Python-2.4至2.7当前 支持的.将来的版本将支持Python-3.0.

MySQL-3.23 through 5.5 and Python-2.4 through 2.7 are currently supported. Python-3.0 will be supported in a future release.

要从Python 3连接到MySQL,您可以使用其他替代方法:

To connect to MySQL from Python 3 you can use other alternatives:

  • mysqlclient
  • mysql-connector-python
  • pymysql
  • cymysql
  • mysqlclient
  • mysql-connector-python
  • pymysql
  • cymysql

更多推荐

pip3安装mysql

本文发布于:2023-07-04 11:03:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1023526.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:mysql

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!