Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/307.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/12.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
Python 将烧瓶应用程序部署到AWS Elastic Beanstalk:“;错误:WSGIPath引用的文件不存在;_Python_Amazon Web Services_Flask_Amazon Elastic Beanstalk - Fatal编程技术网

Python 将烧瓶应用程序部署到AWS Elastic Beanstalk:“;错误:WSGIPath引用的文件不存在;

Python 将烧瓶应用程序部署到AWS Elastic Beanstalk:“;错误:WSGIPath引用的文件不存在;,python,amazon-web-services,flask,amazon-elastic-beanstalk,Python,Amazon Web Services,Flask,Amazon Elastic Beanstalk,我正在努力使用Elastic Beanstalk将flask应用程序部署到AWS。它在本地部署得很好,但当我尝试推到EB时会出现错误 阅读了joshmcode的答案后,我将我的flask应用程序名称从传统的app更改为application,将文件名更改为application.py,并确保Elastic Beanstalk配置文件匹配。这并没有解决问题 我的eb配置文件的相关部分: aws:elasticbeanstalk:container:python: NumProcesses: '1'

我正在努力使用Elastic Beanstalk将flask应用程序部署到AWS。它在本地部署得很好,但当我尝试推到EB时会出现错误

阅读了joshmcode的答案后,我将我的flask应用程序名称从传统的
app
更改为
application
,将文件名更改为application.py,并确保Elastic Beanstalk配置文件匹配。这并没有解决问题

我的
eb配置文件的相关部分:

aws:elasticbeanstalk:container:python:
NumProcesses: '1'
NumThreads: '15'
StaticFiles: /static/=static/
WSGIPath: application.py
我的文件结构:

aws:elasticbeanstalk:container:python:
NumProcesses: '1'
NumThreads: '15'
StaticFiles: /static/=static/
WSGIPath: application.py
在FlaskAWS文件夹中,我有根flask目录(“flask chatterbot”)和虚拟环境,如:

venv 
flask-chatterbot
    -requirements.txt
    -application.py
    Templates 
        -index.html
    Static
        css
           -styles.css
        js 
           -dynam.js
错误前的命令:

  • 在成功地在本地部署之后,我用

    pip freeze>requirements.txt

  • 然后关闭虚拟环境

    停用

  • 使用
    eb init
    命令初始化CLI存储库

    ebinit-python示例chatbot

  • 在这一点上,我选择了Python的版本,并且没有任何问题地设置了SSH密钥

    4) 之后我跑了

    eb create flask-environ 
    
    我收到以下错误:

    MacBook-Air:flaskaws patrickharris$ eb create flask-environ
    Creating application version archive "app-180409_132356".
    Uploading flask-app/app-180409_132356.zip to S3. This may take a while.
    Upload Complete.
    Environment details for: flask-environ
      Application name: flask-app
      Region: us-west-1
      Deployed Version: app-180409_132356
      Environment ID: xxxidxxx
      Platform: arn:aws:elasticbeanstalk:us-west-1::platform/Python 2.6 running on 64bit Amazon Linux/2.6.6
      Tier: WebServer-Standard-1.0
      CNAME: UNKNOWN
      Updated: 2018-04-09 20:23:59.312000+00:00
    Printing Status:
    INFO: createEnvironment is starting.
    INFO: Using elasticbeanstalk-us-west-1-814752048877 as Amazon S3 storage bucket for environment data.
    INFO: Created security group named: sg-0f84dd5f7959f932f
    INFO: Created security group named: awseb-e-7iaptyh9gg-stack-AWSEBSecurityGroup-19AXML05AP8UG
    INFO: Created load balancer named: awseb-e-7-AWSEBLoa-5F4QOOSPZA9I
    INFO: Created Auto Scaling launch configuration named: awseb-e-7iaptyh9gg-stack-AWSEBAutoScalingLaunchConfiguration-1TSKD50BLQBZ7
    INFO: Created Auto Scaling group named: awseb-e-7iaptyh9gg-stack-AWSEBAutoScalingGroup-UN8HHDRN4V2J
    INFO: Waiting for EC2 instances to launch. This may take a few minutes.
    INFO: Created Auto Scaling group policy named: arn:aws:autoscaling:us-west-1:814752048877:scalingPolicy:f03d20db-305d-4eff-83bd-fa5532d682ea:autoScalingGroupName/awseb-e-7iaptyh9gg-stack-AWSEBAutoScalingGroup-UN8HHDRN4V2J:policyName/awseb-e-7iaptyh9gg-stack-AWSEBAutoScalingScaleUpPolicy-154NI4YA5Y480
    INFO: Created Auto Scaling group policy named: arn:aws:autoscaling:us-west-1:814752048877:scalingPolicy:f70e6de5-c82d-48f0-9324-db3fd69813a9:autoScalingGroupName/awseb-e-7iaptyh9gg-stack-AWSEBAutoScalingGroup-UN8HHDRN4V2J:policyName/awseb-e-7iaptyh9gg-stack-AWSEBAutoScalingScaleDownPolicy-MG1G34PEZK13
    INFO: Created CloudWatch alarm named: awseb-e-7iaptyh9gg-stack-AWSEBCloudwatchAlarmLow-ELWRG701RZXB
    INFO: Created CloudWatch alarm named: awseb-e-7iaptyh9gg-stack-AWSEBCloudwatchAlarmHigh-FRMTYE8GUX0W
    ****ERROR: Your WSGIPath refers to a file that does not exist.****
    

    这里的任何帮助都将不胜感激

    eb config中的
    WSGIPath:application.py
    ,但在您的文件结构中它是
    app.py
    。。。让这两个文件名匹配吗?这是我问问题时的错误,我将其从app.py更改为application.py,但仍然收到错误。很好,谢谢。这个问题是怎么解决的?