Hello,
As I mainly work with my Mac, I would lime to use Django and I install it on my Mac.
I installed django with the following command
pip3 install -r requierement.txt
here is my requierment file.
asgiref==3.5.2
Django==4.0.6
sqlparse==0.4.2
I also imported my database with several tables.
Now I run the command ./manage.py inspectdb
and I got that error message
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.
Did you install mysqlclient?
With ubuntu I easly fix that problem with pip3 install mysqlclient but with Mac , I experienced and issue
pip3 install mysqlclient
Collecting mysqlclient
Using cached mysqlclient-2.1.1.tar.gz (88 kB)
Preparing metadata (setup.py) … error
error: subprocess-exited-with-error× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [16 lines of output]
/bin/sh: mysql_config: command not found
/bin/sh: mariadb_config: command not found
/bin/sh: mysql_config: command not found
Traceback (most recent call last):
File “”, line 2, in
File “”, line 34, in
File “/private/var/folders/g8/w2hfprf12w348r4lmt0y1t1r0000gn/T/pip-install-zjcmmh57/mysqlclient_f1524e83310b41288fe3921681ca7af5/setup.py”, line 15, in
metadata, options = get_config()
File “/private/var/folders/g8/w2hfprf12w348r4lmt0y1t1r0000gn/T/pip-install-zjcmmh57/mysqlclient_f1524e83310b41288fe3921681ca7af5/setup_posix.py”, line 70, in get_config
libs = mysql_config(“libs”)
File “/private/var/folders/g8/w2hfprf12w348r4lmt0y1t1r0000gn/T/pip-install-zjcmmh57/mysqlclient_f1524e83310b41288fe3921681ca7af5/setup_posix.py”, line 31, in mysql_config
raise OSError(“{} not found”.format(_mysql_config_path))
OSError: mysql_config not found
mysql_config --version
mariadb_config --version
mysql_config --libs
[end of output]note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
How can i fix it with an OSX?