I am deploying a web app on AWS's elastic beanstalk and am coming across the same error:
[StageApplication]. Stop running the command. Error: chown /var/app/staging/venv/bin/python: no such file or directory.
I see in my environment configuration the property: PYTHONPATH
: /var/app/venv/staging-LQM1lest/bin
My app runs perfectly fine locally with the command 'python applicaiton.py'.
Any advice on how I can fix this?
Make sure you aren't pushing your local venv to your EB referenced Git Repo. I was trying to make updates from another machine and accidentally pushed it to master which caused this exact error. I had to use the following to remove it even after adding to gitignore file. Give that a shot and/or double check.
git rm -r --cached venv
git commit -m 'Remove the now ignored directory venv'
git push origin master
I discovered that eb deploy
was deploying my local venv directory, even though it was in .gitignore. I confirmed this by going to "Application versions" in the sidebar and downloading the deployed .zip file under the "source" column. Sure enough, my venv was in there.
I was running eb deploy
from a subdirectory in my git repo. As I intended, eb
was only deploying this subdirectory. However, for some reason, it was ignoring the .gitignore file I had in this subdirectory. I added a .ebignore file and put my venv in there, and it fixed the problem. Note that when using .ebignore, eb
no longer deploys what's commited in git, but rather what's in the working directory. More here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With