Setting up a Django development environment problem

I’m using mozilla’s guide " Setting up a Django development environment". I’ve on my other Dev Workstation (MX Linux) using the same guide and I had additionally install default-libmysqlclient-dev to install the mysqlclient using “pip install mysqlclient”. I use a VM Mariadb server for all my development database connections.

What is the additional equivalent file I need for RPM base OS, I have not been able to fine a solution to install mysqlclient? I get a very long and multiple attempts of errors like this:

[root@sd2workstation nasheayahu]# pip install mysqlclient
Collecting mysqlclient
  Downloading mysqlclient-2.2.0.tar.gz (89 kB)
     |████████████████████████████████| 89 kB 1.3 MB/s 
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /usr/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/ get_requires_for_build_wheel /tmp/tmpnq2jpbpe
       cwd: /tmp/pip-install-4r3i8dw0/mysqlclient_56769aabfc8e449387be909afd68c090
  Complete output (22 lines):
  Trying pkg-config --exists mysqlclient
  Command 'pkg-config --exists mysqlclient' returned non-zero exit status 1.
  Trying pkg-config --exists mariadb
  Command 'pkg-config --exists mariadb' returned non-zero exit status 1.
  Traceback (most recent call last):
    File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/", line 349, in <module>
    File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/", line 331, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/", line 117, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/tmp/pip-build-env-007kzr6k/overlay/lib/python3.9/site-packages/setuptools/", line 341, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
    File "/tmp/pip-build-env-007kzr6k/overlay/lib/python3.9/site-packages/setuptools/", line 323, in _get_build_requires
    File "/tmp/pip-build-env-007kzr6k/overlay/lib/python3.9/site-packages/setuptools/", line 338, in run_setup
      exec(code, locals())
    File "<string>", line 154, in <module>
    File "<string>", line 48, in get_config_posix
    File "<string>", line 27, in find_package_name
  Exception: Can not find valid pkg-config name.
WARNING: Discarding (from (requires-python:>=3.8). Command errored out with exit status 1: /usr/bin/python3 /usr/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/ get_requires_for_build_wheel /tmp/tmpnq2jpbpe Check the logs for full command output.

and the last message states:

RROR: Could not find a version that satisfies the requirement mysqlclient (from versions: 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.3.7, 1.3.8, 1.3.9, 1.3.10, 1.3.11rc1, 1.3.11, 1.3.12, 1.3.13, 1.3.14, 1.4.0rc1, 1.4.0rc2, 1.4.0rc3, 1.4.0, 1.4.1, 1.4.2, 1.4.2.post1, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.1.0rc1, 2.1.0, 2.1.1, 2.2.0rc1, 2.2.0)
ERROR: No matching distribution found for mysqlclient

How do you correct this?


Finally found the answer here, " Did you install mysqlclient?" by Subarata Talukder.

Now I can have some fun!.. :smiling_face_with_three_hearts:

1 Like

If you want to use mysqlclient instead of pymysql, check in this thread the answer by Mircea Cristian.