繁体   English   中英

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

[英]Elastic Beanstalk, Django deployment error, Could not find a version that satisfies the requirement pkg-resources==0.0.0

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

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

  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)

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

我的requirements.txt

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 次,但没有任何改变。

我看到了和你非常相似的事情。

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

但是,当我检查 eb 日志中的时间戳时,时间戳是在我运行 eb deploy 之前。 我认为在这里您会看到以前的部署失败。

要检查,请运行 eb ssh 以进入您的服务器,并查看 /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 并且由于这个原因在本地仍然失败,那么恐怕我不知道发生了什么!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM