0

When I try to run in my cpanel. I think it does't support mysqlclient.

pip3 install flask-mysqldb

it shows

Collecting flask-mysqldb
  Using cached Flask_MySQLdb-0.2.0-py3-none-any.whl
Collecting mysqlclient
  Using cached mysqlclient-2.0.3.tar.gz (88 kB)
Requirement already satisfied: Flask>=0.10 in /home/babulco1/virtualenv/BabulComputer/3.7/lib/python3.7/site-packages (from flask-mysqldb) (2.0.1)
Requirement already satisfied: Werkzeug>=2.0 in /home/babulco1/virtualenv/BabulComputer/3.7/lib/python3.7/site-packages (from Flask>=0.10->flask-mysqldb) (2.0.1)
Requirement already satisfied: itsdangerous>=2.0 in /home/babulco1/virtualenv/BabulComputer/3.7/lib/python3.7/site-packages (from Flask>=0.10->flask-mysqldb) (2.0.1)
Requirement already satisfied: Jinja2>=3.0 in /home/babulco1/virtualenv/BabulComputer/3.7/lib/python3.7/site-packages (from Flask>=0.10->flask-mysqldb) (3.0.1)
Requirement already satisfied: click>=7.1.2 in /home/babulco1/virtualenv/BabulComputer/3.7/lib/python3.7/site-packages (from Flask>=0.10->flask-mysqldb) (8.0.1)
Requirement already satisfied: importlib-metadata in /home/babulco1/virtualenv/BabulComputer/3.7/lib/python3.7/site-packages (from click>=7.1.2->Flask>=0.10->flask-mysqldb) (4.6.3)
Requirement already satisfied: MarkupSafe>=2.0 in /home/babulco1/virtualenv/BabulComputer/3.7/lib/python3.7/site-packages (from Jinja2>=3.0->Flask>=0.10->flask-mysqldb) (2.0.1)
Requirement already satisfied: typing-extensions>=3.6.4 in /home/babulco1/virtualenv/BabulComputer/3.7/lib/python3.7/site-packages (from importlib-metadata->click>=7.1.2->Flask>=0.10->flask-mysqldb) (3.10.0.0)
Requirement already satisfied: zipp>=0.5 in /home/babulco1/virtualenv/BabulComputer/3.7/lib/python3.7/site-packages (from importlib-metadata->click>=7.1.2->Flask>=0.10->flask-mysqldb) (3.5.0)
Building wheels for collected packages: mysqlclient
  Building wheel for mysqlclient (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for mysqlclient
  Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient, flask-mysqldb
    Running setup.py install for mysqlclient ... error
    ERROR: Command errored out with exit status 1:
    MySQLdb/_mysql.c:46:10: fatal error: Python.h: No such file or directory
     #include "Python.h"
              ^~~~~~~~~~
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/babulco1/virtualenv/BabulComputer/3.7/bin/python3.7_bin -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-u7r3sdst/mysqlclient_2c2bb5ca5cde49b2bc23aa8a04390d32/setup.py'"'"'; __file__='"'"'/tmp/pip-install-u7r3sdst/mysqlclient_2c2bb5ca5cde49b2bc23aa8a04390d32/setup.py'"'"';f = getattr(tokenize,'"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-vmb8inzx/install-record.txt --single-version-externally-managed --compile --install-headers /home/babulco1/virtualenv/BabulComputer/3.7/include/site/python3.7/mysqlclient Check the logs for full command output.

I also try to donload with wheel file but it shows

ERROR: mysqlclient-1.4.6-pp37-pypy37_pp73-win_amd64.whl is not a supported wheel on this platform.
Pierre.Vriens
  • 2,117
  • 75
  • 29
  • 42
  • Did you read this? : https://stackoverflow.com/questions/60623407/installing-superset-error-command-gcc-failed-with-exit-status-1 – Ayse Aug 13 '21 at 13:32
  • The error message `MySQLdb/_mysql.c:46:10: fatal error: Python.h: No such file or directory` is telling you that the Python header files are not installed on the machine. The linked duplicate explains how you might install them. You may need other header files: the MySQLdb docs should list any required dependencies. If you're environment doesn't permit installing header libraries you could consider using a Python-only connector such as mysql-connector-python or pymysql. – snakecharmerb Aug 15 '21 at 13:03

0 Answers0