我正在尝试部署一个使用mysqlclient模块的flask应用程序。我在requirements.txt文件中添加了“mysqlclient==2.0.3”,但它给了我一个前面提到的错误:希望得到一个解决方案来解决这个问题并部署我的应用程序。
*正在收集mysqlclient==2.0.3下载mysqlclient-2.0.3.tar.gz(88 kB)2021/04/30 14:51:41.371493[错误]执行命令[app-deploy]-[InstallDependency]期间出错。停止运行该命令。错误:使用requirements.txt文件安装依赖项失败,错误命令/bin/sh-c/var/app/venv/staging-lqm1lest/bin/pip install-r requirements.txt失败,错误退出状态%1。stderr:error:命令出错,退出状态1:Command:/var/app/venv/staging-lqm1lest/bin/python-c'import sys,setuptools,tokenize;sys.argv[0]=‘“’”‘/tmp/pip-install-ev789p02/mysqlclient_e4290fdb04994f22bf4d9325b9d91254/setup.py'“’”‘;file='“‘”’/tmp/pip-install-ev789p02/mysqlclient_e4290fdb04994f22bf4d9325b9d91254/setup.py'“‘”’;f=getattr(令牌,'“‘”'open''“”’“‘,open)(文件);code=f.read().replace('”’“'\r\n'”‘“’”‘,’“‘”\n'“’”'''“'');f.close();exec(compile(代码,文件,‘”’“'exec'”‘“'))'egg_info--找不到“.format(_mysql_config_path))错误:mysql_config找不到mysql_config--版本mariadb_config--版本mysql_config--libs--------------------警告:丢弃https://files.pythonhosted.org/packages/3C/df/59cd2fa5e48d0804d213bdcb1acb4d08c403b61c7ff7ed4dd4a6a2deb3f7/mysqlclient
2021/04/30 14:51:41.371508[INFO]正在执行清理逻辑2021/04/30 14:51:41.371596[INFO]命令服务响应:{“status”:“failure”,“api_version”:“1.0”,“results”:[{“status”:“failure”,“msg”:“引擎执行遇到错误.”,“returncode”:1,“events”:[{“msg”:“实例部署无法安装应用程序依赖项.部署失败.”,“timestamp”:1619794301,“severity”:“error”},{“msg”:“实例部署失败.有关详细信息,请参阅
检查您的python版本,您使用的是哪个版本,
python -V
上面说
requires-python:>=3.5
如果python版本<3.5,请检查您的python版本
https://stackoverflow.com/questions/45137395/how-do-i-upgrade-the-python-installation-in-windows-10#:~:text=x.z%20(修补程序)%20python%20版本%2c,版本%20with%20a%20new%20one。