Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/335.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
弹性豆茎:/bin/sh:/opt/python/run/venv/bin/activate:没有这样的文件或目录_Python_Django_Amazon Web Services_Amazon Elastic Beanstalk - Fatal编程技术网

弹性豆茎:/bin/sh:/opt/python/run/venv/bin/activate:没有这样的文件或目录

弹性豆茎:/bin/sh:/opt/python/run/venv/bin/activate:没有这样的文件或目录,python,django,amazon-web-services,amazon-elastic-beanstalk,Python,Django,Amazon Web Services,Amazon Elastic Beanstalk,正在尝试部署使用以下频道的django应用程序 以下是我的配置文件: 01_环境配置 option_settings: aws:elasticbeanstalk:container:python: WSGIPath: "dashboard/wsgi.py" aws:elasticbeanstalk:application:environment: DJANGO_SETTINGS_MODULE: "dashboard.settings" PYTHONP

正在尝试部署使用以下频道的django应用程序

以下是我的配置文件:

01_环境配置

option_settings:  
  aws:elasticbeanstalk:container:python:     
    WSGIPath: "dashboard/wsgi.py"
  aws:elasticbeanstalk:application:environment:
    DJANGO_SETTINGS_MODULE: "dashboard.settings"
    PYTHONPATH: /opt/python/current/app/dashboard:$PYTHONPATH

  aws:elbv2:listener:80:
    DefaultProcess: http
    ListenerEnabled: 'true'
    Protocol: HTTP
    Rules: ws
  aws:elbv2:listenerrule:ws:
    PathPatterns: /websockets/*
    Process: websocket
    Priority: 1
  aws:elasticbeanstalk:environment:process:http:
    Port: '80'
    Protocol: HTTP
  aws:elasticbeanstalk:environment:process:websocket:
    Port: '5000'
    Protocol: HTTP
container_commands:
  00_pip_upgrade:
    command: "source /opt/python/run/venv/bin/activate && pip install --upgrade pip"
    ignoreErrors: false
  01_migrate:
    command: "django-admin.py migrate"
    leader_only: true
  02_collectstatic:
    command: "django-admin.py collectstatic --noinput"
  03_wsgipass:
    command: 'echo "WSGIPassAuthorization On" >> ../wsgi.conf'
02_setup.config

option_settings:  
  aws:elasticbeanstalk:container:python:     
    WSGIPath: "dashboard/wsgi.py"
  aws:elasticbeanstalk:application:environment:
    DJANGO_SETTINGS_MODULE: "dashboard.settings"
    PYTHONPATH: /opt/python/current/app/dashboard:$PYTHONPATH

  aws:elbv2:listener:80:
    DefaultProcess: http
    ListenerEnabled: 'true'
    Protocol: HTTP
    Rules: ws
  aws:elbv2:listenerrule:ws:
    PathPatterns: /websockets/*
    Process: websocket
    Priority: 1
  aws:elasticbeanstalk:environment:process:http:
    Port: '80'
    Protocol: HTTP
  aws:elasticbeanstalk:environment:process:websocket:
    Port: '5000'
    Protocol: HTTP
container_commands:
  00_pip_upgrade:
    command: "source /opt/python/run/venv/bin/activate && pip install --upgrade pip"
    ignoreErrors: false
  01_migrate:
    command: "django-admin.py migrate"
    leader_only: true
  02_collectstatic:
    command: "django-admin.py collectstatic --noinput"
  03_wsgipass:
    command: 'echo "WSGIPassAuthorization On" >> ../wsgi.conf'
当我运行
eb create django env
时,它会失败

命令在实例上失败。发生意外错误[错误代码:000000000 1]。

在日志中,我发现原因是:

2020-06-17 16:36:41,880 P4189 [INFO] Command 00_pip_upgrade
2020-06-17 16:36:41,883 P4189 [INFO] -----------------------Command Output-----------------------
2020-06-17 16:36:41,883 P4189 [INFO]    /bin/sh: /opt/python/run/venv/bin/activate: No such file or directory

因此,即使我遵循指南,目录似乎并不存在。我也无法通过SSH连接到EC2实例来检查这一点。Amazon Linux 2中的python venv目录是否已更改?

这不起作用,因为您使用的是
Amazon Linux 2
,而下面的教程正在使用
Amazon Linux 1

要在创建Python环境时使用
Amazon Linux 1
,请选择:

Python 3.6 running on 64bit Amazon Linux

请注意,AL2和AL1之间存在巨大差异,大多数涉及AL1的教程在AL2中不起作用

这不起作用,因为您使用的是
amazonlinux2
,而下面的教程使用的是
amazonlinux1

要在创建Python环境时使用
Amazon Linux 1
,请选择:

Python 3.6 running on 64bit Amazon Linux

请注意,AL2和AL1之间存在巨大差异,大多数涉及AL1的教程在AL2中不起作用

如果您想尝试使用Amazon Linux 2,那么您可以按照

如果您想尝试使用Amazon Linux 2,那么您可以按照

这不回答问题,请不要仅复制文档进行回复。这不回答问题,请不要仅复制文档进行回复。