3

I am trying to deploying a flask application which uses mysqlclient module. I added "mysqlclient==2.0.3" in the requirements.txt file but it is giving me an error as mentioned: Hoping to get a solution in order to resolve this and deploy my application.

*Collecting mysqlclient==2.0.3
  Downloading mysqlclient-2.0.3.tar.gz (88 kB)
2021/04/30 14:51:41.371493 [ERROR] An error occurred during execution of command [app-deploy] - [InstallDependency]. Stop running the command. Error: fail to install dependencies with requirements.txt file with error Command /bin/sh -c /var/app/venv/staging-LQM1lest/bin/pip install -r requirements.txt failed with error exit status 1. Stderr:    ERROR: Command errored out with exit status 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(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-n398ytz1
         cwd: /tmp/pip-install-ev789p02/mysqlclient_e4290fdb04994f22bf4d9325b9d91254/
    Complete output (15 lines):
    /bin/sh: mysql_config: command not found
    /bin/sh: mariadb_config: command not found
    /bin/sh: mysql_config: command not found
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-ev789p02/mysqlclient_e4290fdb04994f22bf4d9325b9d91254/setup.py", line 15, in <module>
        metadata, options = get_config()
      File "/tmp/pip-install-ev789p02/mysqlclient_e4290fdb04994f22bf4d9325b9d91254/setup_posix.py", line 70, in get_config
        libs = mysql_config("libs")
      File "/tmp/pip-install-ev789p02/mysqlclient_e4290fdb04994f22bf4d9325b9d91254/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
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/3c/df/59cd2fa5e48d0804d213bdcb1acb4d08c403b61c7ff7ed4dd4a6a2deb3f7/mysqlclient-2.0.3.tar.gz#sha256=f6ebea7c008f155baeefe16c56cd3ee6239f7a5a9ae42396c2f1860f08a7c432 (from https://pypi.org/simple/mysqlclient/) (requires-python:>=3.5). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement mysqlclient==2.0.3
ERROR: No matching distribution found for mysqlclient==2.0.3
 
2021/04/30 14:51:41.371508 [INFO] Executing cleanup logic
2021/04/30 14:51:41.371596 [INFO] CommandService Response: {"status":"FAILURE","api_version":"1.0","results":[{"status":"FAILURE","msg":"Engine execution has encountered an error.","returncode":1,"events":[{"msg":"Instance deployment failed to install application dependencies. The deployment failed.","timestamp":1619794301,"severity":"ERROR"},{"msg":"Instance deployment failed. For details, see 'eb-engine.log'.","timestamp":1619794301,"severity":"ERROR"}]}]}*
will-hedges
  • 1,254
  • 1
  • 9
  • 18
  • I am using Python3.8. I added packages these packages in .config file which is located in .ebsextension folder: yum: python3-devel: [] mariadb-devel: [] And it was deployed successfully. Thanks for your response. – Karishma Londhe May 03 '21 at 05:35

1 Answers1

2

I edited two files in django project.

.ebextensions/packages.config

packages:
  yum:
    python3-devel: []
    mariadb-devel: []

requirements.txt

...
mysqlclient // just remove ==2.0.3
...
Jay Lim
  • 371
  • 3
  • 14