Django connecting to Mariadb on Fedora 33

I’m trying to install django in a virtual environment.

mkdir my_project
cd my_project
python -m venv project_venv
source project_venv/bin/activate
pip install django
pip install mysqlclient
Collecting mysqlclient
Using cached mysqlclient-2.0.3.tar.gz (88 kB)
   ERROR: Command errored out with exit status 1:
    command: /home/wrnash/Development/Programming/django/project_venv/b
in/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp
.py'"'"'; __file__='"'"'/tmp/pip-install-t14vwuyg/mysqlclient_24e4ca1f59
e9428eba58fb66e27faf27/'"'"';f=getattr(tokenize, '"'"'open'"'"',
open)(__file__);'"'"'\r\n'"'"', '"'"'\n'"'"');f.c
lose();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-bas
e /tmp/pip-pip-egg-info-1lf1mq8k                                         
        cwd: /tmp/pip-install-t14vwuyg/mysqlclient_24e4ca1f59e9428eba58
   Complete output (15 lines):                                          
   /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 "<string>", line 1, in <module>                               
     File "/tmp/pip-install-t14vwuyg/mysqlclient_24e4ca1f59e9428eba58fb
66e27faf27/", line 15, in <module>                               
       metadata, options = get_config()                                 
     File "/tmp/pip-install-t14vwuyg/mysqlclient_24e4ca1f59e9428eba58fb
66e27faf27/", line 70, in get_config                       
       libs = mysql_config("libs")                                      
     File "/tmp/pip-install-t14vwuyg/mysqlclient_24e4ca1f59e9428eba58fb
66e27faf27/", 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                                                  
ERROR: Command errored out with exit status 1: python egg_info
Check the logs for full command output.

I’m currently running Fedora release 33 (Thirty Three)
Has anyone solved this issue?


Do you need to install the database in virtual environment. I have MariaDB and running outside the environment. I’m able to connect to it via PHP and PHPmyadmin.

1 Like

Try to install the package providing one of the missing commands:

sudo dnf install mariadb-connector-c-devel
sudo dnf provides \*/mariadb_config

Thanks. install mariadb-devel solved the issue.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.