'eb deploy error - chown /var/app/staging/venv/bin/python: no such file or directory [duplicate]

Following AWS instructions for (https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html)

Currently trying to run "eb deploy" with the following output:

    Creating application version archive "app-220413_141345835306".
Uploading: [##################################################] 100% Done...
2022-04-13 20:14:00    INFO    Environment update is starting.      
2022-04-13 20:14:05    INFO    Deploying new version to instance(s).
2022-04-13 20:14:09    ERROR   Instance deployment failed. For details, see 'eb-engine.log'.
2022-04-13 20:14:11    ERROR   [Instance: i-0fb1ab203cc59f0d1] Command failed on instance. Return code: 1 Output: Engine execution has encountered an error..
2022-04-13 20:14:11    INFO    Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2022-04-13 20:14:11    ERROR   Unsuccessful command execution on instance id(s) 'i-0fb1ab203cc59f0d1'. Aborting the operation.
2022-04-13 20:14:11    ERROR   Failed to deploy application.        
                                                                      
ERROR: ServiceError - Failed to deploy application.

In the logs I see:

2022/04/13 20:00:19.230141 [INFO] finished extracting /opt/elasticbeanstalk/deployment/app_source_bundle to /var/app/staging/ successfully
2022/04/13 20:00:19.231105 [ERROR] An error occurred during execution of command [app-deploy] - [StageApplication]. Stop running the command. Erro
r: chown /var/app/staging/venv/bin/python: no such file or directory 

Any ideas what to do? I have no idea where that path is coming from



Solution 1:[1]

Th second answer here worked for me: AWS Elastic Beanstalk chown PythonPath error

I added a file caled .ebignore into my main project directory:

~/ebdjango/
|-- .ebignore
|-- .ebextensions
|   `-- django.config
|-- ebdjango
|   |-- __init__.py
|   |-- settings.py
|   |-- urls.py
|   `-- wsgi.py
|-- db.sqlite3
|-- manage.py
`-- requirements.txt

the contents of the file are only one line:

venv

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Daniel Johnson