jork@DESKTOP-7GPF343:/$ pip3 install flask flask-mysqldb
Collecting flask
Using cached Flask-2.0.2-py3-none-any.whl (95 kB)
Collecting flask-mysqldb
Using cached Flask-MySQLdb-0.2.0.tar.gz (2.1 kB)
Collecting Jinja2>=3.0
Using cached Jinja2-3.0.2-py3-none-any.whl (133 kB)
Collecting itsdangerous>=2.0
Using cached itsdangerous-2.0.1-py3-none-any.whl (18 kB)
Collecting click>=7.1.2
Using cached click-8.0.3-py3-none-any.whl (97 kB)
Collecting Werkzeug>=2.0
Using cached Werkzeug-2.0.2-py3-none-any.whl (288 kB)
Collecting mysqlclient
Using cached mysqlclient-2.0.3.tar.gz (88 kB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘»‘»‘/tmp/pip-install-sqssjcyr/mysqlclient/setup.py'»‘»‘; file='»‘»‘/tmp/pip-install-sqssjcyr/mysqlclient/setup.py'»‘»‘;f=getattr(tokenize, ‘»‘»‘open'»‘»‘, open)(file);code=f.read().replace(‘»‘»‘\r\n'»‘»‘, ‘»‘»‘\n'»‘»‘);f.close();exec(compile(code, file, ‘»‘»‘exec'»‘»‘))’ egg_info –egg-base /tmp/pip-install-sqssjcyr/mysqlclient/pip-egg-info
cwd: /tmp/pip-install-sqssjcyr/mysqlclient/
Complete output (15 lines):
/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 «», line 1, in
File «/tmp/pip-install-sqssjcyr/mysqlclient/setup.py», line 15, in
metadata, options = get_config()
File «/tmp/pip-install-sqssjcyr/mysqlclient/setup_posix.py», line 70, in get_config
libs = mysql_config(«libs»)
File «/tmp/pip-install-sqssjcyr/mysqlclient/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
—————————————-
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

SOLUCION:

jork@DESKTOP-7GPF343:/$ sudo apt install libmysqlclient-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following additional packages will be installed:
libmysqlclient21 libssl-dev
Suggested packages:
libssl-doc
The following NEW packages will be installed:
libmysqlclient-dev libmysqlclient21 libssl-dev
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 4478 kB of archives.
After this operation, 25.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libmysqlclient21 amd64 8.0.27-0ubuntu0.20.04.1 [1291 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libssl-dev amd64 1.1.1f-1ubuntu2.8 [1584 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libmysqlclient-dev amd64 8.0.27-0ubuntu0.20.04.1 [1603 kB]
Fetched 4478 kB in 3s (1392 kB/s)
Selecting previously unselected package libmysqlclient21:amd64.
(Reading database … 39249 files and directories currently installed.)
Preparing to unpack …/libmysqlclient21_8.0.27-0ubuntu0.20.04.1_amd64.deb …
Unpacking libmysqlclient21:amd64 (8.0.27-0ubuntu0.20.04.1) …
Selecting previously unselected package libssl-dev:amd64.
Preparing to unpack …/libssl-dev_1.1.1f-1ubuntu2.8_amd64.deb …
Unpacking libssl-dev:amd64 (1.1.1f-1ubuntu2.8) …
Selecting previously unselected package libmysqlclient-dev.
Preparing to unpack …/libmysqlclient-dev_8.0.27-0ubuntu0.20.04.1_amd64.deb …
Unpacking libmysqlclient-dev (8.0.27-0ubuntu0.20.04.1) …
Setting up libmysqlclient21:amd64 (8.0.27-0ubuntu0.20.04.1) …
Setting up libssl-dev:amd64 (1.1.1f-1ubuntu2.8) …
Setting up libmysqlclient-dev (8.0.27-0ubuntu0.20.04.1) …
Processing triggers for man-db (2.9.1-1) …
Processing triggers for libc-bin (2.31-0ubuntu9.2) …

Ahora funciona correctamente:

jork@DESKTOP-7GPF343:/$ pip3 install flask flask-mysqldb
Collecting flask
Using cached Flask-2.0.2-py3-none-any.whl (95 kB)
Collecting flask-mysqldb
Using cached Flask-MySQLdb-0.2.0.tar.gz (2.1 kB)
Collecting click>=7.1.2
Using cached click-8.0.3-py3-none-any.whl (97 kB)
Collecting itsdangerous>=2.0
Using cached itsdangerous-2.0.1-py3-none-any.whl (18 kB)
Collecting Werkzeug>=2.0
Using cached Werkzeug-2.0.2-py3-none-any.whl (288 kB)
Collecting Jinja2>=3.0
Using cached Jinja2-3.0.2-py3-none-any.whl (133 kB)
Collecting mysqlclient
Using cached mysqlclient-2.0.3.tar.gz (88 kB)
Collecting MarkupSafe>=2.0
Downloading MarkupSafe-2.0.1-cp38-cp38-manylinux2010_x86_64.whl (30 kB)
Building wheels for collected packages: flask-mysqldb, mysqlclient
Building wheel for flask-mysqldb (setup.py) … done
Created wheel for flask-mysqldb: filename=Flask_MySQLdb-0.2.0-py3-none-any.whl size=2666 sha256=ad0ffd32cb404a0c814123848453746ff805e98e687eed4c5c141f67446d4959
Stored in directory: /home/jork/.cache/pip/wheels/08/dd/b3/5f7e5b2df5452362c7273b6e7e5554f3855cfc447e7440ec7e
Building wheel for mysqlclient (setup.py) … done
Created wheel for mysqlclient: filename=mysqlclient-2.0.3-cp38-cp38-linux_x86_64.whl size=109308 sha256=b03dc2d91d67cab0337defe8c1bd4b86b2b1c717bc776961ab527f0d0c2b100d
Stored in directory: /home/jork/.cache/pip/wheels/3a/c1/c3/5a19639a551c921c2c2b39468f4278ce5aa27b4e386a4158e4
Successfully built flask-mysqldb mysqlclient
Installing collected packages: click, itsdangerous, Werkzeug, MarkupSafe, Jinja2, flask, mysqlclient, flask-mysqldb
WARNING: The script flask is installed in ‘/home/jork/.local/bin’ which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use –no-warn-script-location.
Successfully installed Jinja2-3.0.2 MarkupSafe-2.0.1 Werkzeug-2.0.2 click-8.0.3 flask-2.0.2 flask-mysqldb-0.2.0 itsdangerous-2.0.1 mysqlclient-2.0.3
jork@DESKTOP-7GPF343:/$