Reputation: 2495
I am trying to deploy an application on AWS but struck at this error and couldn't find how to make it work.
Error:
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
I guess there's been change in AWS Recently as this was working in my previous deployments.
Also I had to change
postgresql93-devel: []
to
postgresql-devel: []
Because it was earlier giving the following error:
Yum does not have postgresql93-devel available for installation
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
option_settings:
aws:elasticbeanstalk:container:python:
WSGIPath: yantraksh_cargo/wsgi.py
wsgi_custom.config
files:
"/etc/httpd/conf.d/wsgihacks.conf":
mode: "000644"
owner: root
group: root
content: |
WSGIPassAuthorization On
Upvotes: 0
Views: 1712
Reputation: 238199
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
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
EDIT:
General migration steps from Amazon Linux 1 to 2 are outline here:
Upvotes: 1