当我尝试在我的 cpanel 中运行时。我认为它不支持mysqlclient。
pip3 install flask-mysqldb
表明
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.
我也尝试使用轮文件下载,但它显示
ERROR: mysqlclient-1.4.6-pp37-pypy37_pp73-win_amd64.whl is not a supported wheel on this platform.