0

I am trying to run a Python Django project as required version of 2.7 of Python, Django of 1.8 and MySQL 5.7. While installing the MySQL-python of 1.2.5, building the wheel it's breaking and getting the below error:

Building wheel for MySQL-python (setup.py) ... error
  ERROR: Command errored out with exit status 1:

error: command 'cc' failed with exit status 1

I link the mysql@5.7, so when I check which mysql_config I am getting /usr/local/opt/mysql@5.7/bin/mysql_config.

I have tried most of the solutions, I have installed MySQL through brew.

I tried installing mysqlclient in virtual env before Django gets installed, but when I tried installing mysqlclient in venv I am getting the same error.

Building wheel for mysqlclient (setup.py) ... error
  ERROR: Command errored out with exit status 1:
error: command 'cc' failed with exit status 1

I am not able to figure what the issue is, since I am new to Python.

halfer
  • 19,824
  • 17
  • 99
  • 186
Learner
  • 8,379
  • 7
  • 44
  • 82
  • Probably this might help: https://ruddra.com/posts/install-mysqlclient-macos/ :) – ruddra Oct 24 '19 at 06:17
  • Thanks for the quick response ,but didnt worked, i am able to install mysqlclient on outside of virtual env but inside virtual env getting the same error tried installing MySQL-python==1.2.5 also didnt worked same error – Learner Oct 24 '19 at 06:28
  • can you please remove the virtual env and create a new one, then try again(if possible) – ruddra Oct 24 '19 at 06:31
  • i didnt get the error, but when i run the application its throwing the below error raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: this is MySQLdb version (1, 2, 5, 'final', 1), but _mysql is version (1, 4, 4, 'final', 0) – Learner Oct 24 '19 at 06:45
  • when i checked brew list these much things are there, is it because of anything , mysql mysql-client mysql-connector-c mysql@5.7 openssl openssl@1.1 – Learner Oct 24 '19 at 06:49
  • should i do link and unlik of the mysql@5.7 or mysql. little confused on it – Learner Oct 24 '19 at 06:51
  • https://stackoverflow.com/questions/46902357/error-loading-mysqldb-module-did-you-install-mysqlclient-or-mysql-python tried this one and now its working . is it correct way. Thanks rudra for the help very much, was struggling a . lot thank u very much :) – Learner Oct 24 '19 at 06:54
  • well django does not support pymysql officially, but if it works out for you then it should be fine – ruddra Oct 24 '19 at 07:11
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/201365/discussion-between-dileep-thomas-and-ruddra). – Learner Oct 24 '19 at 07:12

0 Answers0