mac os上的Django mysql设置错误

时间:2017-10-04 23:52:48

标签: python django macos

] mitwas-MacBook-Air:mytestsite Mitwa $ pip3安装MYSQL-python 收集MYSQL-python

使用缓存的MySQL-python-1.2.5.zip     从命令python setup.py egg_info完成输出:     回溯(最近一次调用最后一次):

  File "<string>", line 1, in <module>
  File "/private/var/folders/9l/9zjr811503367lfnybnyqlqc0000gn/T/pip-build-fk08ytxi/MYSQL-python/setup.py", line 13, in <module>

来自setup_posix导入get_config       文件“/private/var/folders/9l/9zjr811503367lfnybnyqlqc0000gn/T/pip-build-fk08ytxi/MYSQL-python/setup_posix.py”,第2行,in         从ConfigParser导入SafeConfigParser     ImportError:没有名为'ConfigParser'的模块

----------------------------------------

命令“python setup.py egg_info”失败,错误代码1在/ private / var / folders / 9l / 9zjr811503367lfnybnyqlqc0000gn / T / pip-build-fk08ytxi / MYSQL-python /

我在为python设置Django MYSQL时收到此错误。任何人都知道如何解决它?

1 个答案:

答案 0 :(得分:0)

MYSQL-python与Python不兼容3.改为安装mysqlclient。

pip3 install mysqlclient