CalledProcessError: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 2

I try to deploy using AWS Elastic beanstalk but the error is continually occurred

Can anyone give some advice of what and why it is coming.

[Instance: i-01899473c529952e4] Command failed on instance. Return code: 1 Output: (TRUNCATED)...) File "/usr/lib64/python2.7/subprocess.py", line 190, in check_call raise CalledProcessError(retcode, cmd) CalledProcessError: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 2. Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.

My requirements.txt :

appdirs==1.4.3
attrs==19.3.0
awsebcli==3.17.1
bcrypt==3.1.7
blessed==1.17.3
botocore==1.14.17
cached-property==1.5.1
cement==2.8.2
certifi==2019.11.28
cffi==1.14.0
chardet==3.0.4
colorama==0.3.9
cryptography==2.8
distlib==0.3.0
Django==2.2.5
django-countries==6.1
django-dotenv==1.4.2
docker==4.2.0
docker-compose==1.25.4
dockerpty==0.4.1
docopt==0.6.2
docutils==0.15.2
filelock==3.0.12
future==0.16.0
idna==2.9
importlib-metadata==1.5.0
jmespath==0.9.5
jsonschema==3.2.0
paramiko==2.7.1
pathspec==0.5.9
pbr==5.4.4
pipenv==2018.11.26
pipenv-to-requirements==0.9.0
pycparser==2.20
PyNaCl==1.3.0
pyrsistent==0.15.7
python-dateutil==2.8.0
pytz==2019.3
PyYAML==5.2
requests==2.23.0
semantic-version==2.5.0
sentry-sdk==0.14.1
six==1.14.0
sqlparse==0.3.1
termcolor==1.1.0
texttable==1.6.2
urllib3==1.25.8
virtualenv==20.0.13
virtualenv-clone==0.5.3
wcwidth==0.1.8
websocket-client==0.57.0
zipp==3.1.0

.ebextensions>packages.config:

packages:
  yum:
    postgresql96: []
    postgresql96-devel: []
  • I attached full activity-log:


    /var/log/eb-activity.log

    Requirement already satisfied: cached-property==1.5.1 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 7)) Requirement already satisfied: cement==2.8.2 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 8)) Requirement already satisfied: certifi==2019.11.28 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 9)) Requirement already satisfied: cffi==1.14.0 in /opt/python/run/venv/lib64/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 10)) Requirement already satisfied: chardet==3.0.4 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 11)) Requirement already satisfied: colorama==0.3.9 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 12)) Requirement already satisfied: cryptography==2.8 in /opt/python/run/venv/lib64/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 13)) Requirement already satisfied: distlib==0.3.0 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 14)) Requirement already satisfied: Django==2.2.5 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 15)) Collecting django-countries==6.1 (from -r /opt/python/ondeck/app/requirements.txt (line 16)) Requirement already satisfied: django-dotenv==1.4.2 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 17)) Requirement already satisfied: docker==4.2.0 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 18)) Requirement already satisfied: docker-compose==1.25.4 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 19)) Requirement already satisfied: dockerpty==0.4.1 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 20)) Requirement already satisfied: docopt==0.6.2 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 21)) Requirement already satisfied: docutils==0.15.2 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 22)) Requirement already satisfied: filelock==3.0.12 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 23)) Requirement already satisfied: future==0.16.0 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 24)) Requirement already satisfied: idna==2.9 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 25)) Requirement already satisfied: importlib-metadata==1.5.0 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 26)) Requirement already satisfied: jmespath==0.9.5 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 27)) Requirement already satisfied: jsonschema==3.2.0 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 28)) Requirement already satisfied: paramiko==2.7.1 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 29)) Requirement already satisfied: pathspec==0.5.9 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 30)) Requirement already satisfied: pbr==5.4.4 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 31)) Requirement already satisfied: pipenv==2018.11.26 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 32)) Requirement already satisfied: pipenv-to-requirements==0.9.0 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 33)) Requirement already satisfied: pycparser==2.20 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 34)) Requirement already satisfied: PyNaCl==1.3.0 in /opt/python/run/venv/lib64/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 35)) Requirement already satisfied: pyrsistent==0.15.7 in /opt/python/run/venv/lib64/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 36)) Requirement already satisfied: python-dateutil==2.8.0 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 37)) Requirement already satisfied: pytz==2019.3 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 38)) Requirement already satisfied: PyYAML==5.2 in /opt/python/run/venv/lib64/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 39)) Requirement already satisfied: requests==2.23.0 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 40)) Requirement already satisfied: semantic-version==2.5.0 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 41)) Requirement already satisfied: sentry-sdk==0.14.1 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 42)) Requirement already satisfied: six==1.14.0 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 43)) Requirement already satisfied: sqlparse==0.3.1 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 44)) Requirement already satisfied: termcolor==1.1.0 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 45)) Requirement already satisfied: texttable==1.6.2 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 46)) Requirement already satisfied: urllib3==1.25.8 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 47)) Requirement already satisfied: virtualenv==20.0.13 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 48)) Requirement already satisfied: virtualenv-clone==0.5.3 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 49)) Requirement already satisfied: wcwidth==0.1.8 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 50)) Requirement already satisfied: websocket-client==0.57.0 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 51)) Requirement already satisfied: zipp==3.1.0 in /opt/python/run/venv/lib/python3.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 52)) Requirement already satisfied: setuptools>=20.0 in /opt/python/run/venv/lib/python3.6/site-packages (from awsebcli==3.17.1->-r /opt/python/ondeck/app/requirements.txt (line 3)) Requirement already satisfied: pip>=9.0.1 in /opt/python/run/venv/lib/python3.6/site-packages (from pipenv==2018.11.26->-r /opt/python/ondeck/app/requirements.txt (line 32)) Requirement already satisfied: importlib-resources<2,>=1.0; python_version < "3.7" in /opt/python/run/venv/lib/python3.6/site-packages (from virtualenv==20.0.13->-r /opt/python/ondeck/app/requirements.txt (line 48)) Installing collected packages: django-countries Exception: Traceback (most recent call last): File "/opt/python/run/venv/local/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/opt/python/run/venv/local/lib/python3.6/site-packages/pip/commands/install.py", line 342, in run prefix=options.prefix_path, File "/opt/python/run/venv/local/lib/python3.6/site-packages/pip/req/req_set.py", line 784, in install **kwargs File "/opt/python/run/venv/local/lib/python3.6/site-packages/pip/req/req_install.py", line 851, in install self.move_wheel_files(self.source_dir, root=root, prefix=prefix) File "/opt/python/run/venv/local/lib/python3.6/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files isolated=self.isolated, File "/opt/python/run/venv/local/lib/python3.6/site-packages/pip/wheel.py", line 347, in move_wheel_files assert info_dir, "%s .dist-info directory not found" % req AssertionError: django-countries==6.1 .dist-info directory not found You are using pip version 9.0.1, however version 20.0.2 is available. You should consider upgrading via the 'pip install --upgrade pip' command. 2020-03-25 13:27:00,925 ERROR Error installing dependencies: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 2 Traceback (most recent call last): File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 22, in main install_dependencies() File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 18, in install_dependencies check_call('%s install -r %s' % (os.path.join(APP_VIRTUAL_ENV, 'bin', 'pip'), requirements_file), shell=True) File "/usr/lib64/python2.7/subprocess.py", line 190, in check_call raise CalledProcessError(retcode, cmd) CalledProcessError: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 2 (Executor::NonZeroExitStatus)

    [2020-03-25T13:27:00.932Z] INFO [4566] - [Application update app-d355-200325_222607@4/AppDeployStage0/AppDeployPreHook/03deploy.py] : Activity failed. [2020-03-25T13:27:00.932Z] INFO [4566] - [Application update app-d355-200325_222607@4/AppDeployStage0/AppDeployPreHook] : Activity failed. [2020-03-25T13:27:00.933Z] INFO [4566] - [Application update app-d355-200325_222607@4/AppDeployStage0] : Activity failed. [2020-03-25T13:27:00.933Z] INFO [4566] - [Application update app-d355-200325_222607@4] : Completed activity. Result: Application update - Command CMD-AppDeploy failed [2020-03-25T14:16:33.538Z] INFO [6267] - [CMD-BundleLogs] : Starting activity... [2020-03-25T14:16:33.538Z] INFO [6267] - [CMD-BundleLogs/AddonsBefore] : Starting activity... [2020-03-25T14:16:33.538Z] INFO [6267] - [CMD-BundleLogs/AddonsBefore] : Completed activity. [2020-03-25T14:16:33.539Z] INFO [6267] - [CMD-BundleLogs/BundleLogs] : Starting activity... [2020-03-25T14:16:33.539Z] INFO [6267] - [CMD-BundleLogs/BundleLogs/BundleLogs] : Starting activity... [2020-03-25T14:16:33.750Z] INFO [6267] - [CMD-BundleLogs/BundleLogs/BundleLogs] : Completed activity. [2020-03-25T14:16:33.750Z] INFO [6267] - [CMD-BundleLogs/BundleLogs] : Completed activity. Result: CMD-BundleLogs - stage 0 - Command CMD-BundleLogs stage 0 completed [2020-03-25T14:16:33.750Z] INFO [6267] - [CMD-BundleLogs/AddonsAfter] : Starting activity... [2020-03-25T14:16:33.750Z] INFO [6267] - [CMD-BundleLogs/AddonsAfter] : Completed activity. [2020-03-25T14:16:33.751Z] INFO [6267] - [CMD-BundleLogs] : Completed activity. Result: CMD-BundleLogs - Command CMD-BundleLogs succeeded [2020-03-25T14:16:54.981Z] INFO [6286] - [CMD-TailLogs] : Starting activity... [2020-03-25T14:16:54.981Z] INFO [6286] - [CMD-TailLogs/AddonsBefore] : Starting activity... [2020-03-25T14:16:54.981Z] INFO [6286] - [CMD-TailLogs/AddonsBefore] : Completed activity. [2020-03-25T14:16:54.981Z] INFO [6286] - [CMD-TailLogs/TailLogs] : Starting activity... [2020-03-25T14:16:54.981Z] INFO [6286] - [CMD-TailLogs/TailLogs/TailLogs] : Starting activity...