构建期间发生错误:命令setuptools失败 [英] Error occurred during build: Command setuptools failed

查看:85
本文介绍了构建期间发生错误:命令setuptools失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在AWS上部署应用程序,但是遇到此错误,无法找到使之运行的方法.

I am trying to deploy an application on AWS but struck at this error and couldn't find how to make it work.

错误:

在构建过程中发生错误:命令设置工具失败

Error occurred during build: Command setuptools failed

01_packages.config

packages:
  yum:
    git: []
    postgresql-devel: []
    libjpeg-turbo-devel: []

commands:
    setuptools:
      command: /opt/python/run/venv/bin/pip install setuptools --upgrade

我想最近AWS发生了变化,因为这在我以前的部署中一直有效.

I guess there's been change in AWS Recently as this was working in my previous deployments.

我还必须更改

postgresql93-devel: []

postgresql-devel: []

因为它先前给出了以下错误:

Because it was earlier giving the following error:

Yum没有可用于安装的postgresql93-devel

Yum does not have postgresql93-devel available for installation

db-migrate.congig

db-migrate.congig

container_commands:
  01_migrate:
    command: "django-admin.py migrate --noinput"
    leader_only: true
option_settings:
  aws:elasticbeanstalk:application:environment:
    DJANGO_SETTINGS_MODULE: app_name.settings

django.config

django.config

option_settings:
  aws:elasticbeanstalk:container:python:
    WSGIPath: yantraksh_cargo/wsgi.py

wsgi_custom.config

wsgi_custom.config

files:
  "/etc/httpd/conf.d/wsgihacks.conf":
    mode: "000644"
    owner: root
    group: root
    content: |
      WSGIPassAuthorization On

推荐答案

此操作失败,因为文件/opt/python/run/venv/bin/pip 不存在.至少不是在Amazon Linux 2(python env)上.

This fails because file /opt/python/run/venv/bin/pip does not exist. Not at least on Amazon Linux 2 (python env).

要解决此问题,您可以使用

To fixed that, you can use

commands:
    setuptools:
      command: pip install setuptools --upgrade

要检查其是否有效,我在测试EB环境(64bit Amazon Linux 2 v3.0.1 running Python 3.7)上进行了验证:

To check if it works, I verified it on a test EB env (64bit Amazon Linux 2 v3.0.1 running Python 3.7):

2020-05-28 07:47:14,369 P3704 [INFO] Command setuptools
2020-05-28 07:47:16,759 P3704 [INFO] -----------------------Command Output-----------------------
2020-05-28 07:47:16,759 P3704 [INFO]    Collecting setuptools
2020-05-28 07:47:16,759 P3704 [INFO]      Downloading setuptools-46.4.0-py3-none-any.whl (583 kB)
2020-05-28 07:47:16,759 P3704 [INFO]    Installing collected packages: setuptools
2020-05-28 07:47:16,759 P3704 [INFO]      Attempting uninstall: setuptools
2020-05-28 07:47:16,759 P3704 [INFO]        Found existing installation: setuptools 38.4.0
2020-05-28 07:47:16,759 P3704 [INFO]        Uninstalling setuptools-38.4.0:
2020-05-28 07:47:16,760 P3704 [INFO]          Successfully uninstalled setuptools-38.4.0
2020-05-28 07:47:16,760 P3704 [INFO]    Successfully installed setuptools-46.4.0

从此处概述从Amazon Linux 1到2的一般迁移步骤:

General migration steps from Amazon Linux 1 to 2 are outline here:

这篇关于构建期间发生错误:命令setuptools失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆