首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Elastic Beanstalk,Django部署错误,找不到满足要求pkg-resources==0.0.0的版本

Elastic Beanstalk,Django部署错误,找不到满足要求pkg-resources==0.0.0的版本
EN

Stack Overflow用户
提问于 2020-07-08 02:34:18
回答 1查看 269关注 0票数 0

我正尝试在Elastic Beanstalk上部署我的django项目。我正在关注官方文档和this article,我认为我已经正确地完成了这些资源中要求的大多数事情。

但我的部署每次都会失败。在eb logs上我发现了这个错误

代码语言:javascript
复制
  No matching distribution found for pkg-resources==0.0.0 (from -r /opt/python/ondeck/app/requirements.txt (line 27))
  You are using pip version 9.0.1, however version 20.1.1 is available.
  You should consider upgrading via the 'pip install --upgrade pip' command.
  2020-07-07 18:19:51,388 ERROR    Error installing dependencies: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 1
  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 1 (Executor::NonZeroExitStatus)

到目前为止,我的问题似乎与this stackoverflow question非常相似,但事实并非如此。我从requirements.txt中删除了pkg-resources==0.0.0,但它仍然给我相同的错误。

我的requirements.txt

代码语言:javascript
复制
asgiref==3.2.10
attrs==19.3.0
awsebcli==3.18.1
bcrypt==3.1.7
blessed==1.17.8
botocore==1.15.49
cached-property==1.5.1
cement==2.8.2
certifi==2020.6.20
cffi==1.14.0
chardet==3.0.4
colorama==0.4.3
cryptography==2.9.2
Django==3.0.8
django-cors-headers==3.3.0
djangorestframework==3.11.0
djangorestframework-simplejwt==4.4.0
docker==4.2.2
docker-compose==1.25.5
dockerpty==0.4.1
docopt==0.6.2
docutils==0.15.2
future==0.16.0
idna==2.7
importlib-metadata==1.7.0
jmespath==0.10.0
jsonschema==3.2.0
paramiko==2.7.1
pathspec==0.5.9
psycopg2-binary==2.8.5
pycparser==2.20
PyJWT==1.7.1
PyNaCl==1.4.0
pyrsistent==0.16.0
python-dateutil==2.8.0
pytz==2020.1
PyYAML==5.3.1
requests==2.20.1
semantic-version==2.5.0
six==1.11.0
sqlparse==0.3.1
termcolor==1.1.0
texttable==1.6.2
urllib3==1.24.3
wcwidth==0.1.9
websocket-client==0.57.0
zipp==3.1.0

我已经尝试了大约5次启动新的应用程序和新的环境,但没有任何变化。

EN

回答 1

Stack Overflow用户

发布于 2020-10-24 05:20:08

我看到了一个和你非常相似的东西。

我在需求文件中进行了更改,删除了pkg-resources==0.0.0,但是在运行eb日志时,当我运行eb deploy时,它仍然因为这个原因而失败。

但是,当我检查eb日志中的时间戳时,时间戳是在我运行eb deploy之前。我认为这里显示的是上一次部署的失败。

要进行检查,请运行eb进入您的服务器,并查看/var/ log /eb-engine.log,最新的日志应该是命令实际失败原因的信息(如果您遵循该教程,可能是因为找不到pg_config )。

您还可以按照注释的建议在服务器上运行/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt来验证这是您的问题,并查看是否仍然遇到相同的错误。

如果您的文件/opt/python/ondeck/app/requirements.txt不包含pkg-resources,并且由于这个原因仍然在本地失败,那么我恐怕不知道发生了什么!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62781783

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档