简体   繁体   English

尝试通过pip安装mysql-connector时发生Python错误

[英]Python error trying install mysql-connector via pip

I'm to trying create a project in Python using Django. 我正在尝试使用Django在Python中创建一个项目。 One of the dependencies is a connection with Mysql. 依赖项之一是与Mysql的连接。 I'm Using pip to import whatever I need. 我正在使用pip导入所需的任何内容。

My problem is the error when I run this line: sudo pip3 install mysql-python 我的问题是运行此行时出现错误: sudo pip3 install mysql-python

The return is: 返回是:

Collecting mysql-python Using cached https://files.pythonhosted.org/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-6dok9yt5/mysql-python/setup.py", line 13, in <module> from setup_posix import get_config File "/tmp/pip-install-6dok9yt5/mysql-python/setup_posix.py", line 2, in <module> from ConfigParser import SafeConfigParser ModuleNotFoundError: No module named 'ConfigParser'

The final line is: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-6dok9yt5/mysql-python/ 最后一行是: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-6dok9yt5/mysql-python/

Someone can help me? 有人可以帮我吗? Thanks in advance! 提前致谢!

As far as I know "mysql-python" currently does not support python3 据我所知,“ mysql-python”目前不支持python3

MySQL-3.23 through 5.5 and Python-2.4 through 2.7 are currently supported. 当前支持MySQL-3.23至5.5和Python-2.4至2.7。 Python-3.0 will be supported in a future release. 将来的版本将支持Python-3.0。 PyPy is supported. 支持PyPy。

Maybe this will help: 也许这会有所帮助:
https://stackoverflow.com/a/25724855/966660 https://stackoverflow.com/a/25724855/966660

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM