Fault in requirements.txt comand

hello, i get the following when i run the command

pip install -r requirements.txt

(env) root@flaskPowerBI:/var/www/html/flask_project# pip install -r requirements.txt
Collecting autopep8==1.5.7
  Using cached autopep8-1.5.7-py2.py3-none-any.whl (45 kB)
Collecting click==8.0.1
  Using cached click-8.0.1-py3-none-any.whl (97 kB)
Collecting colorama==0.4.4
  Using cached colorama-0.4.4-py2.py3-none-any.whl (16 kB)
Collecting Flask==2.0.1
  Using cached Flask-2.0.1-py3-none-any.whl (94 kB)
Collecting Flask-Login==0.5.0
  Using cached Flask_Login-0.5.0-py2.py3-none-any.whl (16 kB)
Collecting Flask-MySQLdb==0.2.0
  Using cached Flask-MySQLdb-0.2.0.tar.gz (2.1 kB)
  Preparing metadata (setup.py) ... done
Collecting Flask-WTF==0.15.1
  Using cached Flask_WTF-0.15.1-py2.py3-none-any.whl (13 kB)
Collecting itsdangerous==2.0.1
  Using cached itsdangerous-2.0.1-py3-none-any.whl (18 kB)
Collecting Jinja2==3.0.1
  Using cached Jinja2-3.0.1-py3-none-any.whl (133 kB)
Collecting MarkupSafe==2.0.1
  Using cached MarkupSafe-2.0.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (30 kB)
Collecting mysqlclient==2.0.3
  Using cached mysqlclient-2.0.3.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: 1: mysql_config: not found
      /bin/sh: 1: mariadb_config: not found
      /bin/sh: 1: mysql_config: not found
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-lprz8hoy/mysqlclient_6d654e5e6ff14874b5153f2ba63b0fea/setup.py", line 15, in <module>
          metadata, options = get_config()
        File "/tmp/pip-install-lprz8hoy/mysqlclient_6d654e5e6ff14874b5153f2ba63b0fea/setup_posix.py", line 70, in get_config
          libs = mysql_config("libs")
        File "/tmp/pip-install-lprz8hoy/mysqlclient_6d654e5e6ff14874b5153f2ba63b0fea/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

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

and later I do a pip list to verify if it has installed anything and I see that there is nothing.
Does anyone know what is failing?
Thank you.

There is an error in the output. That is way it is failing.

1 Like

This means that you need to install MySQL. The mysqlclient package allows Python code to work with MySQL databases, but MySQL itself is not written in Python. You will need to install it separately.

1 Like