简体   繁体   中英

I was trying to deploy a flask app on AWS elastic beanstalk, but am getting this error

2021/03/29 20:18:33.034586 [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-fywg_th6/mysqlclient_03fe0c7d79f0459190ffa7e229b7666a/setup.py'"'"'; __file__='"'"'/tmp/pip-install-fywg_th6/mysqlclient_03fe0c7d79f0459190ffa7e229b7666a/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-kktixq46
         cwd: /tmp/pip-install-fywg_th6/mysqlclient_03fe0c7d79f0459190ffa7e229b7666a/
    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-fywg_th6/mysqlclient_03fe0c7d79f0459190ffa7e229b7666a/setup.py", line 15, in <module>
        metadata, options = get_config()
      File "/tmp/pip-install-fywg_th6/mysqlclient_03fe0c7d79f0459190ffa7e229b7666a/setup_posix.py", line 70, in get_config
        libs = mysql_config("libs")
      File "/tmp/pip-install-fywg_th6/mysqlclient_03fe0c7d79f0459190ffa7e229b7666a/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

I used pymysql instead of Flask-MySQLdb and mysqlclient. Worked fine after that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM