I have a Django application which it's deployed to Elastic Beanstalk, Amazon Linux 2 AMI and I'm very new with AWS. I have to use pythonocc-core package in my application and I cannot install it via pip. If I SSH into an instance and install it manually, it won't be a great way because of autoscaling of EB environment. I added the .config file below for installing anaconda and my deployment was successful.
commands:
00_download_conda:
command: 'wget https://repo.anaconda.com/archive/Anaconda3-2020.02-Linux-x86_64.sh'
test: test ! -d /anaconda
01_install_conda:
command: 'bash Anaconda3-2020.02-Linux-x86_64.sh -b -f -p /anaconda'
test: test ! -d /anaconda
02_create_home:
command: 'mkdir -p /home/wsgi'
Deployment failed when I added the following command lines to the continuation of this .config file.
commands:
03_conda_create:
command: conda create --name=whatever-name python=3.7
04_conda_activate:
command: source activate whatever-name
05_conda_install:
command: conda install -c dlr-sc pythonocc-core=7.4.0
But I've got an error such as below.
Traceback (most recent call last):
File "/opt/aws/bin/cfn-init", line 171, in <module>
worklog.build(metadata, configSets)
File "/usr/lib/python2.7/site-packages/cfnbootstrap/construction.py", line 129, in build
Contractor(metadata).build(configSets, self)
File "/usr/lib/python2.7/site-packages/cfnbootstrap/construction.py", line 530, in build
self.run_config(config, worklog)
File "/usr/lib/python2.7/site-packages/cfnbootstrap/construction.py", line 542, in run_config
CloudFormationCarpenter(config, self._auth_config).build(worklog)
File "/usr/lib/python2.7/site-packages/cfnbootstrap/construction.py", line 260, in build
changes['commands'] = CommandTool().apply(self._config.commands)
File "/usr/lib/python2.7/site-packages/cfnbootstrap/command_tool.py", line 117, in apply
raise ToolError(u"Command %s failed" % name)
ToolError: Command 03_conda_create failed
How can I fix this issue?