繁体   English   中英

AWS Beanstalk 部署问题

[英]AWS Beanstalk deployement issue

我是 AWS 的初学者。 我一直在尝试在 beantalk 上部署 Web 应用程序,但没有成功。 我使用 Codepiple 连接到我的 Github,但部署执行失败。 我检查了 beantalk 的日志文件,它说:

Collecting flask_mysqldb==1.0.1
  Using cached Flask-MySQLdb-1.0.1.tar.gz (4.3 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting Flask_SQLAlchemy==2.5.1
  Using cached Flask_SQLAlchemy-2.5.1-py2.py3-none-any.whl (17 kB)
Collecting Pillow==9.3.0
  Using cached Pillow-9.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.2 MB)
Collecting mysql==0.0.3
  Using cached mysql-0.0.3-py3-none-any.whl (1.2 kB)
Collecting mysqlclient==2.1.1
  Using cached mysqlclient-2.1.1.tar.gz (88 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'

2022/12/15 22:45:50.073862 [INFO]   error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [16 lines of output]
      /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 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-jkf8sex7/mysqlclient_652b2c543c58458181f58f3950c00b59/setup.py", line 15, in <module>
          metadata, options = get_config()
        File "/tmp/pip-install-jkf8sex7/mysqlclient_652b2c543c58458181f58f3950c00b59/setup_posix.py", line 70, in get_config
          libs = mysql_config("libs")
        File "/tmp/pip-install-jkf8sex7/mysqlclient_652b2c543c58458181f58f3950c00b59/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
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

2022/12/15 22:45:50.073898 [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: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [16 lines of output]
      /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 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-jkf8sex7/mysqlclient_652b2c543c58458181f58f3950c00b59/setup.py", line 15, in <module>
          metadata, options = get_config()
        File "/tmp/pip-install-jkf8sex7/mysqlclient_652b2c543c58458181f58f3950c00b59/setup_posix.py", line 70, in get_config
          libs = mysql_config("libs")
        File "/tmp/pip-install-jkf8sex7/mysqlclient_652b2c543c58458181f58f3950c00b59/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
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.

我的 requirements.txt 上有这个

aiohttp==3.8.3
Django==4.1.4
Flask==2.0.2
Flask_Login==0.6.0
flask_mysqldb==1.0.1
Flask_SQLAlchemy==2.5.1
Pillow==9.3.0
mysql==0.0.3
mysqlclient==2.1.1
Werkzeug==2.0.0
jinja2~=3.0.3

我不确定如何解决这个问题。

错误是:

  OSError: mysql_config not found
  mysql_config --version
  mariadb_config --version
  mysql_config --libs

似乎您没有在您的环境中安装任何 mysql 客户端包。 如果您使用的是容器,请检查您的 Dockerfile 是否正在安装此工具。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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