Amazon web services 部署SAM教程应用程序时未找到需求文件

Amazon web services 部署SAM教程应用程序时未找到需求文件,amazon-web-services,aws-sam,aws-sam-cli,Amazon Web Services,Aws Sam,Aws Sam Cli,我想开始使用aws sam在本地测试我的lambda。我试着把教程从 我使用saminit--runtime python3.6 然后当我这么做的时候 sam构建——使用容器我得到一个奇怪的异常,它无法获取requirements.txt。我该怎么办?我使用pyhon 3.7.2 2019-02-13 10:06:42 Using SAM Template at C:\Users\XXXX\Documents\sam-app\template.yaml 2019-02-13 10:06:42 C

我想开始使用aws sam在本地测试我的lambda。我试着把教程从

我使用
saminit--runtime python3.6
然后当我这么做的时候
sam构建——使用容器
我得到一个奇怪的异常,它无法获取requirements.txt。我该怎么办?我使用pyhon 3.7.2

2019-02-13 10:06:42 Using SAM Template at C:\Users\XXXX\Documents\sam-app\template.yaml
2019-02-13 10:06:42 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-p
2019-02-13 10:06:42 Changing event name from before-call.apigateway to before-call.api-gateway
2019-02-13 10:06:42 Changing event name from request-created.machinelearning.Predict to request-created.machine
.Predict
2019-02-13 10:06:42 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to be
meter-build.auto-scaling.CreateLaunchConfiguration
2019-02-13 10:06:42 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2019-02-13 10:06:42 Changing event name from request-created.cloudsearchdomain.Search to request-created.clouds
ain.Search
2019-02-13 10:06:42 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to d
o-scaling.CreateLaunchConfiguration.complete-section
2019-02-13 10:06:42 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-b
dwatch-logs.CreateExportTask
2019-02-13 10:06:42 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch
ateExportTask.complete-section
2019-02-13 10:06:42 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-paramete
loudsearch-domain.Search
2019-02-13 10:06:42 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudse
in.Search.complete-section
2019-02-13 10:06:42 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-p
2019-02-13 10:06:42 Changing event name from before-call.apigateway to before-call.api-gateway
2019-02-13 10:06:42 Changing event name from request-created.machinelearning.Predict to request-created.machine
.Predict
2019-02-13 10:06:42 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to be
meter-build.auto-scaling.CreateLaunchConfiguration
2019-02-13 10:06:42 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2019-02-13 10:06:42 Changing event name from request-created.cloudsearchdomain.Search to request-created.clouds
ain.Search
2019-02-13 10:06:42 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to d
o-scaling.CreateLaunchConfiguration.complete-section
2019-02-13 10:06:42 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-b
dwatch-logs.CreateExportTask
2019-02-13 10:06:42 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch
ateExportTask.complete-section
2019-02-13 10:06:42 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-paramete
loudsearch-domain.Search
2019-02-13 10:06:42 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudse
in.Search.complete-section
2019-02-13 10:06:42 'build' command is called
2019-02-13 10:06:42 Starting Build inside a container
2019-02-13 10:06:42 Looking for credentials via: env
2019-02-13 10:06:42 Looking for credentials via: assume-role
2019-02-13 10:06:42 Looking for credentials via: shared-credentials-file
2019-02-13 10:06:42 Found credentials in shared credentials file: ~/.aws/credentials
2019-02-13 10:06:42 Loading JSON file: C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\botocore\dat
ts.json
2019-02-13 10:06:42 Event choose-service-name: calling handler <function handle_service_name_alias at 0x0000023
>
2019-02-13 10:06:42 Loading JSON file: C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\botocore\dat
essrepo\2017-09-08\service-2.json
2019-02-13 10:06:42 Event creating-client-class.serverlessapplicationrepository: calling handler <function add_
presigned_url at 0x00000237DD8E8EA0>
2019-02-13 10:06:42 The s3 config key is not a dictionary type, ignoring its value of: None
2019-02-13 10:06:42 Setting serverlessrepo timeout as (60, 60)
2019-02-13 10:06:42 Loading JSON file: C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\botocore\dat
json
2019-02-13 10:06:42 Registering retry handlers for service: serverlessrepo
2019-02-13 10:06:42 No Parameters detected in the template
2019-02-13 10:06:42 2 resources found in the template
2019-02-13 10:06:42 Found Serverless function with name='HelloWorldFunction' and CodeUri='hello_world/'
2019-02-13 10:06:42 Trying paths: ['C:\\Users\\XXXX\\.docker\\config.json', 'C:\\Users\\XXXX\\.dockercf
2019-02-13 10:06:42 Found file at path: C:\Users\XXXX\.docker\config.json
2019-02-13 10:06:42 Found 'credsStore' section
2019-02-13 10:06:42 Building resource 'HelloWorldFunction'
2019-02-13 10:06:43 Trying paths: ['C:\\Users\\XXXX\\.docker\\config.json', 'C:\\Users\\XXXX\\.dockercf
2019-02-13 10:06:43 Found file at path: C:\Users\XXXX\.docker\config.json
2019-02-13 10:06:43 Found 'credsStore' section
2019-02-13 10:06:43 http://localhost:None "GET /v1.35/images/lambci/lambda:build-python3.6/json HTTP/1.1" 200 N
2019-02-13 10:06:43 Looking for auth config
2019-02-13 10:06:43 Using credentials store "wincred"
2019-02-13 10:06:43 Looking for auth entry for 'https://index.docker.io/v1/'
2019-02-13 10:06:43 No entry found
2019-02-13 10:06:43 No entry in credstore - fetching from auth dict
2019-02-13 10:06:43 Looking for auth entry for 'docker.io'
2019-02-13 10:06:43 No entry found
2019-02-13 10:06:43 No auth config found
2019-02-13 10:06:45 http://localhost:None "POST /v1.35/images/create?tag=build-python3.6&fromImage=lambci%2Flam
1.1" 200 None

Fetching lambci/lambda:build-python3.6 Docker container image......
2019-02-13 10:06:45 Mounting C:\Users\XXXX\Documents\sam-app\hello_world as /tmp/samcli/source:ro inside ru
tainer
2019-02-13 10:06:45 http://localhost:None "POST /v1.35/containers/create HTTP/1.1" 201 90
2019-02-13 10:06:45 http://localhost:None "GET /v1.35/containers/daa68e5aa3872c114bf1ed108626f6e526829570d9affa
523a55d8c/json HTTP/1.1" 200 None
2019-02-13 10:06:45 http://localhost:None "GET /v1.35/containers/daa68e5aa3872c114bf1ed108626f6e526829570d9affa
523a55d8c/json HTTP/1.1" 200 None
2019-02-13 10:06:47 http://localhost:None "POST /v1.35/containers/daa68e5aa3872c114bf1ed108626f6e526829570d9aff
9523a55d8c/start HTTP/1.1" 204 0
2019-02-13 10:06:47 http://localhost:None "GET /v1.35/containers/daa68e5aa3872c114bf1ed108626f6e526829570d9affa
523a55d8c/json HTTP/1.1" 200 None
2019-02-13 10:06:47 http://localhost:None "POST /containers/daa68e5aa3872c114bf1ed108626f6e526829570d9affa75e3b
5d8c/attach?stdout=1&stderr=1&logs=1&stream=1&stdin=0 HTTP/1.1" 101 0
Using the request object from command line argument
Loading workflow module 'aws_lambda_builders.workflows'
Registering workflow 'PythonPipBuilder' with capability 'Capability(language='python', dependency_manager='pip'
tion_framework=None)'
Registering workflow 'NodejsNpmBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm'
tion_framework=None)'
Registering workflow 'RubyBundlerBuilder' with capability 'Capability(language='ruby', dependency_manager='bund
lication_framework=None)'
Found workflow 'PythonPipBuilder' to support capabilities 'Capability(language='python', dependency_manager='pi
cation_framework=None)'
Running workflow 'PythonPipBuilder'
Running PythonPipBuilder:ResolveDependencies
PythonPipBuilder:ResolveDependencies failed
Traceback (most recent call last):
  File "/var/lang/lib/python3.6/site-packages/aws_lambda_builders/workflows/python_pip/actions.py", line 27, in
    self.scratch_dir
  File "/var/lang/lib/python3.6/site-packages/aws_lambda_builders/workflows/python_pip/packager.py", line 140,
dependencies
    raise RequirementsFileNotFoundError(requirements_path)
aws_lambda_builders.workflows.python_pip.packager.RequirementsFileNotFoundError: Requirements file not found: /
i/source/requirements.txt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/lang/lib/python3.6/site-packages/aws_lambda_builders/workflow.py", line 164, in run
    action.execute()
  File "/var/lang/lib/python3.6/site-packages/aws_lambda_builders/workflows/python_pip/actions.py", line 30, in
    raise ActionFailedError(str(ex))
aws_lambda_builders.actions.ActionFailedError: Requirements file not found: /tmp/samcli/source/requirements.txt
Builder workflow failed
Traceback (most recent call last):
  File "/var/lang/lib/python3.6/site-packages/aws_lambda_builders/workflows/python_pip/actions.py", line 27, in
    self.scratch_dir
  File "/var/lang/lib/python3.6/site-packages/aws_lambda_builders/workflows/python_pip/packager.py", line 140,
dependencies
    raise RequirementsFileNotFoundError(requirements_path)
aws_lambda_builders.workflows.python_pip.packager.RequirementsFileNotFoundError: Requirements file not found: /
i/source/requirements.txt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/lang/lib/python3.6/site-packages/aws_lambda_builders/workflow.py", line 164, in run
    action.execute()
  File "/var/lang/lib/python3.6/site-packages/aws_lambda_builders/workflows/python_pip/actions.py", line 30, in
    raise ActionFailedError(str(ex))
aws_lambda_builders.actions.ActionFailedError: Requirements file not found: /tmp/samcli/source/requirements.txt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/lang/lib/python3.6/site-packages/aws_lambda_builders/__main__.py", line 98, in main
    options=params["options"])
  File "/var/lang/lib/python3.6/site-packages/aws_lambda_builders/builder.py", line 108, in build
    return workflow.run()
  File "/var/lang/lib/python3.6/site-packages/aws_lambda_builders/workflow.py", line 173, in run
    reason=str(ex))
aws_lambda_builders.exceptions.WorkflowFailedError: PythonPipBuilder:ResolveDependencies - Requirements file no
/tmp/samcli/source/requirements.txt
2019-02-13 10:06:47 Build inside container returned response {"jsonrpc": "2.0", "id": 1, "error": {"code": 400,
": "PythonPipBuilder:ResolveDependencies - Requirements file not found: /tmp/samcli/source/requirements.txt"}}
2019-02-13 10:06:48 http://localhost:None "GET /v1.35/containers/daa68e5aa3872c114bf1ed108626f6e526829570d9affa
523a55d8c/json HTTP/1.1" 200 None
2019-02-13 10:06:48 http://localhost:None "DELETE /v1.35/containers/daa68e5aa3872c114bf1ed108626f6e526829570d9a
049523a55d8c?v=False&link=False&force=True HTTP/1.1" 204 0
Build Failed
Error: PythonPipBuilder:ResolveDependencies - Requirements file not found: /tmp/samcli/source/requirements.txt
2019-02-13 10:06:42在C:\Users\XXXX\Documents\SAM app\Template.yaml使用SAM模板
2019-02-13 10:06:42将事件名称从creating-client-class.iot-data更改为creating-client-class.iot-data-p
2019-02-13 10:06:42将事件名称从before-call.api-gateway更改为before-call.api-gateway
2019-02-13 10:06:42将事件名称从request-created.machinelearning.Predict更改为request-created.machine
预测
2019-02-13 10:06:42将事件名称从before-parameter-build.autoscaling.CreateLaunchConfiguration更改为
meter-build.auto-scaling.CreateLaunchConfiguration
2019-02-13 10:06:42将事件名称从before-parameter-build.route53更改为before-parameter-build.route-53
2019-02-13 10:06:42将事件名称从request-created.cloudsearchdomain.Search更改为request-created.clouds
艾因,搜查
2019-02-13 10:06:42将事件名称从docs.*.autoscaling.CreateLaunchConfiguration.complete-section更改为d
o-scaling.CreateLaunchConfiguration.complete-section
2019-02-13 10:06:42将事件名称从before-parameter-build.logs.CreateExportTask更改为before-parameter-b
dwatch-logs.CreateExportTask
2019-02-13 10:06:42将事件名称从docs.*.logs.CreateExportTask.complete-section更改为docs.*.cloudwatch
ateExportTask.complete-section
2019-02-13 10:06:42将事件名称从before-parameter-build.cloudsearchdomain.Search更改为before-parameter
loudsearch-domain.Search
2019-02-13 10:06:42将事件名称从docs.*.cloudsearchdomain.Search.complete-section更改为docs.*.cloudse
in.Search.complete-section
2019-02-13 10:06:42将事件名称从creating-client-class.iot-data更改为creating-client-class.iot-data-p
2019-02-13 10:06:42将事件名称从before-call.api-gateway更改为before-call.api-gateway
2019-02-13 10:06:42将事件名称从request-created.machinelearning.Predict更改为request-created.machine
预测
2019-02-13 10:06:42将事件名称从before-parameter-build.autoscaling.CreateLaunchConfiguration更改为
meter-build.auto-scaling.CreateLaunchConfiguration
2019-02-13 10:06:42将事件名称从before-parameter-build.route53更改为before-parameter-build.route-53
2019-02-13 10:06:42将事件名称从request-created.cloudsearchdomain.Search更改为request-created.clouds
艾因,搜查
2019-02-13 10:06:42将事件名称从docs.*.autoscaling.CreateLaunchConfiguration.complete-section更改为d
o-scaling.CreateLaunchConfiguration.complete-section
2019-02-13 10:06:42将事件名称从before-parameter-build.logs.CreateExportTask更改为before-parameter-b
dwatch-logs.CreateExportTask
2019-02-13 10:06:42将事件名称从docs.*.logs.CreateExportTask.complete-section更改为docs.*.cloudwatch
ateExportTask.complete-section
2019-02-13 10:06:42将事件名称从before-parameter-build.cloudsearchdomain.Search更改为before-parameter
loudsearch-domain.Search
2019-02-13 10:06:42将事件名称从docs.*.cloudsearchdomain.Search.complete-section更改为docs.*.cloudse
in.Search.complete-section
2019-02-13 10:06:42调用“构建”命令
2019-02-13 10:06:42开始在容器内构建
2019-02-13 10:06:42通过:env查找凭据
2019-02-13 10:06:42通过:担任角色查找凭据
2019-02-13 10:06:42通过共享凭据文件查找凭据
2019-02-13 10:06:42在共享凭据文件中找到凭据:~/.aws/credentials
2019-02-13 10:06:42加载JSON文件:C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site packages\botocore\dat
ts.json
2019-02-13 10:06:42事件选择服务名称:调用处理程序
2019-02-13 10:06:42加载JSON文件:C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site packages\botocore\dat
essrepo\2017-09-08\service-2.json
2019-02-13 10:06:42事件创建-client-class.serverlessapplicationrepository:调用处理程序
2019-02-13 10:06:42 s3配置键不是字典类型,忽略其值:None
2019-02-13 10:06:42将serverlessrepo超时设置为(60,60)
2019-02-13 10:06:42加载JSON文件:C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site packages\botocore\dat
json
2019-02-13 10:06:42为服务注册重试处理程序:serverlessrepo
2019-02-13 10:06:42模板中未检测到任何参数
2019-02-13 10:06:42在模板中找到2个资源
2019-02-13 10:06:42找到了名为='HelloWorldFunction'和CodeUri='hello_world/'的无服务器函数
2019-02-13 10:06:42尝试路径:['C:\\Users\\XXXX\\.docker\\config.json','C:\\Users\\XXXX\.dockercf
2019-02-13 10:06:42在路径C:\Users\XXXX\.docker\config.json处找到文件
2019-02-13 10:06:42发现“Credstore”路段
2019-02-13 10:06:42建筑资源“HelloWorldFunction”
2019-02-13 10:06:43尝试路径:['C:\\Users\\XXXX\\.docker\\config.json','C:\\Users\\XXXX\.dockercf
2019-02-13 10:06:43在路径C:\Users\XXXX\.docker\config.json处找到文件
2019-02-13 10:06:43发现“Credstore”路段
2019-02-13 10:06:43 http://localhost:None “GET/v1.35/images/lambci/lambda:build-python3.6/json HTTP/1.1”200 N
2019-02-13 10:06:43正在查找身份验证配置
2019-02-13 10:06:43使用凭证存储“wincred”
2019-02-13 10:06:43正在查找'https://index.docker.io/v1/'
2019-02-13 10:06:43未找到入口
2019-02-13 10:06:43凭证存储中无条目-从授权目录获取
2019-02-13 10:06:43正在查找“docker.io”的授权条目
2019-02-13 10:06:43未找到入口
2019-02-13 10:06:43未找到身份验证配置
2019-02-13 10:06:45 http://localhost:None “POST/v1.35/images/create?tag=build-python3.6&fromImage=lambci%2Flam
1.1“200无
正在获取lambci/lambda:build-python3.6 Docker容器映像。。。。。。
2019-02-13 10:06:45
Requirements file not found: /tmp/samcli/source/requirements.txt