首页 > 解决方案 > AWS Elastic Beanstalk chown PythonPath 错误

问题描述

我正在 AWS 的弹性 beantalk 上部署一个 Web 应用程序,并且遇到了同样的错误:

[StageApplication]. Stop running the command. Error: chown /var/app/staging/venv/bin/python: no such file or directory.

我在我的环境配置中看到了属性PYTHONPATH::/var/app/venv/staging-LQM1lest/bin

我的应用程序使用命令“python applicaiton.py”在本地运行得非常好。

关于如何解决这个问题的任何建议?

标签: pythonpython-3.xamazon-web-servicesflaskamazon-elastic-beanstalk

解决方案


确保您没有将本地 venv 推送到您的 EB 引用的 Git Repo。我试图从另一台机器上进行更新,但不小心将它推送到 master,这导致了这个确切的错误。即使在添加到 gitignore 文件后,我也必须使用以下内容将其删除。试一试和/或仔细检查。

git rm -r --cached venv
git commit -m 'Remove the now ignored directory venv'
git push origin master

推荐阅读