SAM 构建仅使用 --use-container 参数成功完成
SAM Build only completes successfully with --use-container parameter
我正在开发一个用 python3.6 编写的 Lambda 函数以在本地测试,然后在工作后部署到 AWS。为此,我正在使用 PyCharm 的 AWS 无服务器工具包。
不包含 --use-container
参数时,SAM 构建未成功构建。
选中 'use container' 复选框后,我可以构建该函数,但我真的不明白为什么没有这个复选框它就无法工作。
我的requirements.txt
文件如下:
sagemaker
boto3
pandas
s3fs
numpy
pathlib
带参数:
"C:\Program Files\Amazon\AWSSAMCLI\bin\sam.cmd" build --template C:\Users\------\PycharmProjects\AutomatedSageMakerTraining\template.yaml --build-dir C:\Users\------\PycharmProjects\AutomatedSageMakerTraining\.aws-sam\build --use-container AutomatedSageMakerEvaluation
2019-08-20 09:23:29 Starting Build inside a container
2019-08-20 09:23:30 Building resource 'AutomatedSageMakerEvaluation'
Fetching lambci/lambda:build-python3.6 Docker container image......
2019-08-20 09:23:32 Mounting C:\Users\------\PycharmProjects\AutomatedSageMakerTraining as /tmp/samcli/source:ro,delegated inside runtime container
Build Succeeded
Built Artifacts : ..\..\..\..\Users\------\PycharmProjects\AutomatedSageMakerTraining\.aws-sam\build
Built Template : ..\..\..\..\Users\------\PycharmProjects\AutomatedSageMakerTraining\.aws-sam\build\template.yaml
Commands you can use next
=========================
[*] Invoke Function: sam local invoke -t ..\..\..\..\Users\------\PycharmProjects\AutomatedSageMakerTraining\.aws-sam\build\template.yaml
[*] Package: sam package --s3-bucket <yourbucket> --template-file ..\..\..\..\Users\------\PycharmProjects\AutomatedSageMakerTraining\.aws-sam\build\template.yaml
Running PythonPipBuilder:ResolveDependencies
Running PythonPipBuilder:CopySource
无参数:
"C:\Program Files\Amazon\AWSSAMCLI\bin\sam.cmd" build --template C:\Users\------\PycharmProjects\AutomatedSageMakerTraining\template.yaml --build-dir C:\Users\------\PycharmProjects\AutomatedSageMakerTraining\.aws-sam\build AutomatedSageMakerEvaluation
2019-08-20 09:16:30 Building resource 'AutomatedSageMakerEvaluation'
2019-08-20 09:16:30 Running PythonPipBuilder:ResolveDependencies
Build Failed
Error: PythonPipBuilder:ResolveDependencies - {bcrypt==3.1.7(wheel), protobuf3-to-dict==0.1.5(sdist), fsspec==0.4.1(sdist), dockerpty==0.4.1(sdist), pycparser==2.19(sdist), texttable==0.9.1(sdist), pyyaml==3.13(wheel), cryptography==2.7(wheel), docopt==0.6.2(sdist), s3fs==0.3.3(sdist), pynacl==1.3.0(wheel), pywin32==224(wheel), pathlib==1.0.1(sdist), sagemaker==1.37.1(sdist)}
为了帮助调试此错误,我 运行 使用带有 --debug 参数的相同命令:
"C:\Program Files\Amazon\AWSSAMCLI\bin\sam.cmd" build --template C:\Users\------\PycharmProjects\AutomatedSageMakerTraining\template.yaml --build-dir C:\Users\------\PycharmProjects\AutomatedSageMakerTraining\.aws-sam\build AutomatedSageMakerEvaluation --debug
2019-08-20 09:30:14 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2019-08-20 09:30:14 Changing event name from before-call.apigateway to before-call.api-gateway
2019-08-20 09:30:14 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2019-08-20 09:30:14 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2019-08-20 09:30:14 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2019-08-20 09:30:14 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2019-08-20 09:30:14 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
2019-08-20 09:30:14 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2019-08-20 09:30:14 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
2019-08-20 09:30:14 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2019-08-20 09:30:14 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
2019-08-20 09:30:14 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2019-08-20 09:30:14 Changing event name from before-call.apigateway to before-call.api-gateway
2019-08-20 09:30:14 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2019-08-20 09:30:14 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2019-08-20 09:30:14 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2019-08-20 09:30:14 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2019-08-20 09:30:14 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
2019-08-20 09:30:14 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2019-08-20 09:30:14 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
2019-08-20 09:30:14 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2019-08-20 09:30:14 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
2019-08-20 09:30:14 Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2019-08-20 09:30:14 'build' command is called
2019-08-20 09:30:14 No Parameters detected in the template
2019-08-20 09:30:14 2 resources found in the template
2019-08-20 09:30:14 Found Serverless function with name='AutomatedSageMakerTraining' and CodeUri='.'
2019-08-20 09:30:14 Found Serverless function with name='AutomatedSageMakerEvaluation' and CodeUri='.'
2019-08-20 09:30:15 Building resource 'AutomatedSageMakerEvaluation'
2019-08-20 09:30:15 Loading workflow module 'aws_lambda_builders.workflows'
2019-08-20 09:30:15 Registering workflow 'PythonPipBuilder' with capability 'Capability(language='python', dependency_manager='pip', application_framework=None)'
2019-08-20 09:30:15 Registering workflow 'NodejsNpmBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm', application_framework=None)'
2019-08-20 09:30:15 Registering workflow 'RubyBundlerBuilder' with capability 'Capability(language='ruby', dependency_manager='bundler', application_framework=None)'
2019-08-20 09:30:15 Registering workflow 'GoDepBuilder' with capability 'Capability(language='go', dependency_manager='dep', application_framework=None)'
2019-08-20 09:30:15 Registering workflow 'GoModulesBuilder' with capability 'Capability(language='go', dependency_manager='modules', application_framework=None)'
2019-08-20 09:30:15 Registering workflow 'JavaGradleWorkflow' with capability 'Capability(language='java', dependency_manager='gradle', application_framework=None)'
2019-08-20 09:30:15 Registering workflow 'JavaMavenWorkflow' with capability 'Capability(language='java', dependency_manager='maven', application_framework=None)'
2019-08-20 09:30:15 Registering workflow 'DotnetCliPackageBuilder' with capability 'Capability(language='dotnet', dependency_manager='cli-package', application_framework=None)'
2019-08-20 09:30:15 Found workflow 'PythonPipBuilder' to support capabilities 'Capability(language='python', dependency_manager='pip', application_framework=None)'
2019-08-20 09:30:15 Running workflow 'PythonPipBuilder'
2019-08-20 09:30:15 Running PythonPipBuilder:ResolveDependencies
2019-08-20 09:30:15 calling pip download -r C:\Users\------\PycharmProjects\AutomatedSageMakerTraining\requirements.txt --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z
2019-08-20 09:31:20 Full dependency closure: {sagemaker==1.37.1(sdist), docker-pycreds==0.4.0(wheel), fsspec==0.4.1(sdist), setuptools==41.1.0(wheel), botocore==1.12.211(wheel), boto3==1.9.211(wheel), websocket-client==0.56.0(wheel), paramiko==2.6.0(wheel), docker==3.7.3(wheel), protobuf3-to-dict==0.1.5(sdist), scipy==1.3.1(wheel), cryptography==2.7(wheel), jmespath==0.9.4(wheel), six==1.12.0(wheel), pynacl==1.3.0(wheel), python-dateutil==2.8.0(wheel), docutils==0.15.2(wheel), chardet==3.0.4(wheel), docopt==0.6.2(sdist), requests==2.20.1(wheel), s3transfer==0.2.1(wheel), colorama==0.4.1(wheel), cached-property==1.5.1(wheel), asn1crypto==0.24.0(wheel), dockerpty==0.4.1(sdist), protobuf==3.9.1(wheel), jsonschema==2.6.0(wheel), pytz==2019.2(wheel), pywin32==224(wheel), certifi==2019.6.16(wheel), pyyaml==3.13(wheel), numpy==1.17.0(wheel), pycparser==2.19(sdist), idna==2.7(wheel), s3fs==0.3.3(sdist), pathlib==1.0.1(sdist), texttable==0.9.1(sdist), cffi==1.12.3(wheel), pypiwin32==223(wheel), pandas==0.25.0(wheel), urllib3==1.24.3(wheel), docker-compose==1.24.1(wheel), bcrypt==3.1.7(wheel)}
2019-08-20 09:31:20 initial compatible: {docker-pycreds==0.4.0(wheel), setuptools==41.1.0(wheel), botocore==1.12.211(wheel), boto3==1.9.211(wheel), websocket-client==0.56.0(wheel), paramiko==2.6.0(wheel), docker==3.7.3(wheel), jmespath==0.9.4(wheel), six==1.12.0(wheel), python-dateutil==2.8.0(wheel), chardet==3.0.4(wheel), docutils==0.15.2(wheel), requests==2.20.1(wheel), s3transfer==0.2.1(wheel), colorama==0.4.1(wheel), cached-property==1.5.1(wheel), asn1crypto==0.24.0(wheel), jsonschema==2.6.0(wheel), pytz==2019.2(wheel), certifi==2019.6.16(wheel), idna==2.7(wheel), pypiwin32==223(wheel), urllib3==1.24.3(wheel), docker-compose==1.24.1(wheel)}
2019-08-20 09:31:20 initial incompatible: {pyyaml==3.13(wheel), numpy==1.17.0(wheel), protobuf3-to-dict==0.1.5(sdist), scipy==1.3.1(wheel), pycparser==2.19(sdist), sagemaker==1.37.1(sdist), s3fs==0.3.3(sdist), pathlib==1.0.1(sdist), cryptography==2.7(wheel), fsspec==0.4.1(sdist), texttable==0.9.1(sdist), dockerpty==0.4.1(sdist), protobuf==3.9.1(wheel), cffi==1.12.3(wheel), pynacl==1.3.0(wheel), pandas==0.25.0(wheel), docopt==0.6.2(sdist), pywin32==224(wheel), bcrypt==3.1.7(wheel)}
2019-08-20 09:31:20 Downloading missing wheels: {pyyaml==3.13(wheel), numpy==1.17.0(wheel), protobuf3-to-dict==0.1.5(sdist), pycparser==2.19(sdist), scipy==1.3.1(wheel), sagemaker==1.37.1(sdist), s3fs==0.3.3(sdist), pathlib==1.0.1(sdist), cryptography==2.7(wheel), fsspec==0.4.1(sdist), texttable==0.9.1(sdist), dockerpty==0.4.1(sdist), protobuf==3.9.1(wheel), cffi==1.12.3(wheel), pynacl==1.3.0(wheel), pandas==0.25.0(wheel), docopt==0.6.2(sdist), pywin32==224(wheel), bcrypt==3.1.7(wheel)}
2019-08-20 09:31:20 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z pyyaml==3.13
2019-08-20 09:31:21 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z numpy==1.17.0
2019-08-20 09:31:27 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z protobuf3-to-dict==0.1.5
2019-08-20 09:31:28 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z pycparser==2.19
2019-08-20 09:31:29 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z scipy==1.3.1
2019-08-20 09:31:39 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z sagemaker==1.37.1
2019-08-20 09:31:40 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z s3fs==0.3.3
2019-08-20 09:31:41 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z pathlib==1.0.1
2019-08-20 09:31:42 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z cryptography==2.7
2019-08-20 09:31:44 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z fsspec==0.4.1
2019-08-20 09:31:45 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z texttable==0.9.1
2019-08-20 09:31:46 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z dockerpty==0.4.1
2019-08-20 09:31:47 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z protobuf==3.9.1
2019-08-20 09:31:49 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z cffi==1.12.3
2019-08-20 09:31:51 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z pynacl==1.3.0
2019-08-20 09:31:52 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z pandas==0.25.0
2019-08-20 09:32:01 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z docopt==0.6.2
2019-08-20 09:32:02 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\-------\AppData\Local\Temp\tmpnbl_t57z pywin32==224
2019-08-20 09:32:03 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z bcrypt==3.1.7
2019-08-20 09:32:04 compatible wheels after second download pass: {docker-pycreds==0.4.0(wheel), setuptools==41.1.0(wheel), botocore==1.12.211(wheel), boto3==1.9.211(wheel), websocket-client==0.56.0(wheel), paramiko==2.6.0(wheel), docker==3.7.3(wheel), scipy==1.3.1(wheel), jmespath==0.9.4(wheel), six==1.12.0(wheel), python-dateutil==2.8.0(wheel), docutils==0.15.2(wheel), chardet==3.0.4(wheel), requests==2.20.1(wheel), s3transfer==0.2.1(wheel), colorama==0.4.1(wheel), cached-property==1.5.1(wheel), asn1crypto==0.24.0(wheel), protobuf==3.9.1(wheel), jsonschema==2.6.0(wheel), pytz==2019.2(wheel), certifi==2019.6.16(wheel), numpy==1.17.0(wheel), idna==2.7(wheel), cffi==1.12.3(wheel), pypiwin32==223(wheel), pandas==0.25.0(wheel), urllib3==1.24.3(wheel), docker-compose==1.24.1(wheel)}
2019-08-20 09:32:04 Build missing wheels from sdists (C compiling True): {protobuf3-to-dict==0.1.5(sdist), pycparser==2.19(sdist), sagemaker==1.37.1(sdist), s3fs==0.3.3(sdist), pathlib==1.0.1(sdist), fsspec==0.4.1(sdist), texttable==0.9.1(sdist), dockerpty==0.4.1(sdist), docopt==0.6.2(sdist)}
2019-08-20 09:32:04 calling pip wheel --no-deps --wheel-dir C:\Users\-------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\protobuf3-to-dict-0.1.5.tar.gz
2019-08-20 09:32:07 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\pycparser-2.19.tar.gz
2019-08-20 09:32:10 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\sagemaker-1.37.1.tar.gz
2019-08-20 09:32:13 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\s3fs-0.3.3.tar.gz
2019-08-20 09:32:16 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\pathlib-1.0.1.tar.gz
2019-08-20 09:32:18 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\fsspec-0.4.1.tar.gz
2019-08-20 09:32:20 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\texttable-0.9.1.tar.gz
2019-08-20 09:32:23 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\dockerpty-0.4.1.tar.gz
2019-08-20 09:32:25 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\docopt-0.6.2.tar.gz
2019-08-20 09:32:28 compatible after building wheels (no C compiling): {docker-pycreds==0.4.0(wheel), setuptools==41.1.0(wheel), botocore==1.12.211(wheel), boto3==1.9.211(wheel), websocket-client==0.56.0(wheel), paramiko==2.6.0(wheel), docker==3.7.3(wheel), scipy==1.3.1(wheel), jmespath==0.9.4(wheel), six==1.12.0(wheel), python-dateutil==2.8.0(wheel), docutils==0.15.2(wheel), chardet==3.0.4(wheel), requests==2.20.1(wheel), s3transfer==0.2.1(wheel), colorama==0.4.1(wheel), cached-property==1.5.1(wheel), asn1crypto==0.24.0(wheel), protobuf==3.9.1(wheel), jsonschema==2.6.0(wheel), pytz==2019.2(wheel), certifi==2019.6.16(wheel), numpy==1.17.0(wheel), idna==2.7(wheel), cffi==1.12.3(wheel), pypiwin32==223(wheel), pandas==0.25.0(wheel), urllib3==1.24.3(wheel), docker-compose==1.24.1(wheel)}
2019-08-20 09:32:28 Build missing wheels from sdists (C compiling False): {protobuf3-to-dict==0.1.5(sdist), pycparser==2.19(sdist), sagemaker==1.37.1(sdist), s3fs==0.3.3(sdist), pathlib==1.0.1(sdist), fsspec==0.4.1(sdist), texttable==0.9.1(sdist), dockerpty==0.4.1(sdist), docopt==0.6.2(sdist)}
2019-08-20 09:32:28 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\protobuf3-to-dict-0.1.5.tar.gz
2019-08-20 09:32:28 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\pycparser-2.19.tar.gz
2019-08-20 09:32:28 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\sagemaker-1.37.1.tar.gz
2019-08-20 09:32:28 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\s3fs-0.3.3.tar.gz
2019-08-20 09:32:28 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\pathlib-1.0.1.tar.gz
2019-08-20 09:32:28 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\fsspec-0.4.1.tar.gz
2019-08-20 09:32:28 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\texttable-0.9.1.tar.gz
2019-08-20 09:32:28 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\dockerpty-0.4.1.tar.gz
2019-08-20 09:32:28 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\docopt-0.6.2.tar.gz
2019-08-20 09:32:28 compatible after building wheels (C compiling): {docker-pycreds==0.4.0(wheel), setuptools==41.1.0(wheel), botocore==1.12.211(wheel), boto3==1.9.211(wheel), websocket-client==0.56.0(wheel), paramiko==2.6.0(wheel), docker==3.7.3(wheel), scipy==1.3.1(wheel), jmespath==0.9.4(wheel), six==1.12.0(wheel), python-dateutil==2.8.0(wheel), docutils==0.15.2(wheel), chardet==3.0.4(wheel), requests==2.20.1(wheel), s3transfer==0.2.1(wheel), colorama==0.4.1(wheel), cached-property==1.5.1(wheel), asn1crypto==0.24.0(wheel), protobuf==3.9.1(wheel), jsonschema==2.6.0(wheel), pytz==2019.2(wheel), certifi==2019.6.16(wheel), numpy==1.17.0(wheel), idna==2.7(wheel), cffi==1.12.3(wheel), pypiwin32==223(wheel), pandas==0.25.0(wheel), urllib3==1.24.3(wheel), docker-compose==1.24.1(wheel)}
2019-08-20 09:32:28 Final compatible: {cached-property==1.5.1(wheel), docker-pycreds==0.4.0(wheel), asn1crypto==0.24.0(wheel), setuptools==41.1.0(wheel), protobuf==3.9.1(wheel), botocore==1.12.211(wheel), jsonschema==2.6.0(wheel), pytz==2019.2(wheel), boto3==1.9.211(wheel), certifi==2019.6.16(wheel), websocket-client==0.56.0(wheel), paramiko==2.6.0(wheel), urllib3==1.24.3(wheel), docker==3.7.3(wheel), numpy==1.17.0(wheel), scipy==1.3.1(wheel), idna==2.7(wheel), chardet==3.0.4(wheel), jmespath==0.9.4(wheel), six==1.12.0(wheel), cffi==1.12.3(wheel), pypiwin32==223(wheel), python-dateutil==2.8.0(wheel), docutils==0.15.2(wheel), requests==2.20.1(wheel), pandas==0.25.0(wheel), docker-compose==1.24.1(wheel), s3transfer==0.2.1(wheel), colorama==0.4.1(wheel)}
2019-08-20 09:32:28 Final incompatible: {pyyaml==3.13(wheel), numpy==1.17.0(wheel), scipy==1.3.1(wheel), cryptography==2.7(wheel), protobuf==3.9.1(wheel), cffi==1.12.3(wheel), pynacl==1.3.0(wheel), pandas==0.25.0(wheel), pywin32==224(wheel), bcrypt==3.1.7(wheel)}
2019-08-20 09:32:28 Final missing wheels: {pyyaml==3.13(wheel), protobuf3-to-dict==0.1.5(sdist), pycparser==2.19(sdist), sagemaker==1.37.1(sdist), s3fs==0.3.3(sdist), pathlib==1.0.1(sdist), cryptography==2.7(wheel), fsspec==0.4.1(sdist), texttable==0.9.1(sdist), dockerpty==0.4.1(sdist), pynacl==1.3.0(wheel), docopt==0.6.2(sdist), pywin32==224(wheel), bcrypt==3.1.7(wheel)}
2019-08-20 09:32:55 PythonPipBuilder:ResolveDependencies failed
Traceback (most recent call last):
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\workflows\python_pip\actions.py", line 39, in execute
self.scratch_dir
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\workflows\python_pip\packager.py", line 143, in build_dependencies
requirements_path, artifacts_dir_path, scratch_dir_path)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\workflows\python_pip\packager.py", line 212, in build_site_packages
raise MissingDependencyError(packages_without_wheels)
aws_lambda_builders.workflows.python_pip.packager.MissingDependencyError: {pyyaml==3.13(wheel), protobuf3-to-dict==0.1.5(sdist), pycparser==2.19(sdist), sagemaker==1.37.1(sdist), s3fs==0.3.3(sdist), pathlib==1.0.1(sdist), cryptography==2.7(wheel), fsspec==0.4.1(sdist), texttable==0.9.1(sdist), dockerpty==0.4.1(sdist), pynacl==1.3.0(wheel), docopt==0.6.2(sdist), pywin32==224(wheel), bcrypt==3.1.7(wheel)}
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\workflow.py", line 248, in run
action.execute()
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\workflows\python_pip\actions.py", line 42, in execute
raise ActionFailedError(str(ex))
aws_lambda_builders.actions.ActionFailedError: {pyyaml==3.13(wheel), protobuf3-to-dict==0.1.5(sdist), pycparser==2.19(sdist), sagemaker==1.37.1(sdist), s3fs==0.3.3(sdist), pathlib==1.0.1(sdist), cryptography==2.7(wheel), fsspec==0.4.1(sdist), texttable==0.9.1(sdist), dockerpty==0.4.1(sdist), pynacl==1.3.0(wheel), docopt==0.6.2(sdist), pywin32==224(wheel), bcrypt==3.1.7(wheel)}
Build Failed
2019-08-20 09:32:55 Sending Telemetry: {'metrics': [{'commandRun': {'awsProfileProvided': False, 'debugFlagProvided': True, 'region': '', 'commandName': 'sam build', 'duration': 160781, 'exitReason': 'UserException', 'exitCode': 1, 'requestId': '943b9308-c11b-43e0-9d6d-5bbc984946ad', 'installationId': '0c5d4463-668a-4706-ae40-afd0704d66bd', 'sessionId': '4736e025-2966-4a4b-aeb6-2702fe347779', 'executionEnvironment': 'CLI', 'pyversion': '3.6.7', 'samcliVersion': '0.19.0'}}]}
2019-08-20 09:32:55 Starting new HTTPS connection (1): aws-serverless-tools-telemetry.us-west-2.amazonaws.com:443
2019-08-20 09:32:56 HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)
Error: PythonPipBuilder:ResolveDependencies - {pyyaml==3.13(wheel), protobuf3-to-dict==0.1.5(sdist), pycparser==2.19(sdist), sagemaker==1.37.1(sdist), s3fs==0.3.3(sdist), pathlib==1.0.1(sdist), cryptography==2.7(wheel), fsspec==0.4.1(sdist), texttable==0.9.1(sdist), dockerpty==0.4.1(sdist), pynacl==1.3.0(wheel), docopt==0.6.2(sdist), pywin32==224(wheel), bcrypt==3.1.7(wheel)}
似乎出于某种原因,当未设置 --use-container 参数时它无法解析兼容的依赖项。
幸运的是,我能够通过将 template.yaml 部署为无服务器 (CloudFormation) 应用程序,将 Lambda 函数部署到容器内的 AWS,如果我不选中此框,它也会失败。
请检查您的 requirements.txt 文件,我遇到了同样的问题,但我注意到该文件有一个输入 <-|在文件的最后,祝你好运。
我不知道为什么这适用于 --use-container
,但我遇到了同样的问题,而且似乎没有其他人回答这个问题。
您尝试使用的某些库似乎缺少 wheel 文件。它实际上在调试消息中是这样说的,但是如果您不知道要查找什么,则不容易找到。在 https://pythonwheels.com/.
了解更多关于轮子的信息
所以,经过几个小时的挖掘,我 运行 在终端中输入以下命令:
pip install wheel
之后,我可以在本地构建、调用函数,并在没有 --use-container
参数的情况下部署到 AWS。
我有同样的问题,特别是 psycopg2
,pip install wheel
或 --use-container
没有帮助。
我所做的是安装有问题的包的二进制版本 pip install psycopg2-binary
,并且还在 requirements.txt
文件中包含 psycopg2-binary
。
这解决了我的问题,希望对您有所帮助。
根据您的特定 dependency/dependencies,一种可能有效或无效的解决方法是 使用您的问题 dependency/dependencies 可能存在的先前版本之一,因此可能 (a) 具有较旧的依赖项,这些依赖项可能在 PyPI 上有轮子或 (b) 缺少有问题的依赖项。
例如,PythonPipBuilder:ResolveDependencies
错误是由 jsonschema==3.2.0
引发的,因为它依赖于 pyrsistent
目前在 PyPI 上没有轮子。但是,jsonschema==2.6.0
不会产生错误,因为它不依赖于 pyrsistent
.
我在使用 python3.8.8
时遇到了同样的问题,安装了 pyenv
。我还在调试输出中发现了关于 wheel
的提示,但它已经安装了。
我可以通过升级 pip
来修复它:
/Users/xyz/.pyenv/versions/3.8.8/bin/python3.8 -m pip install --upgrade pip
正如其他人所提到的,某些软件包版本可能缺少 wheel 文件。在我的例子中,依赖树中某处的包的新版本是罪魁祸首。
我为解决这个问题所做的是将该包的先前版本明确添加到我的 requirements.txt 文件中。
所以收到后Error: PythonPipBuilder:ResolveDependencies - {greenlet==1.1.0(wheel)}
我将 greenlet==1.0.0
添加到我的需求文件中。
我正在开发一个用 python3.6 编写的 Lambda 函数以在本地测试,然后在工作后部署到 AWS。为此,我正在使用 PyCharm 的 AWS 无服务器工具包。
不包含 --use-container
参数时,SAM 构建未成功构建。
选中 'use container' 复选框后,我可以构建该函数,但我真的不明白为什么没有这个复选框它就无法工作。
我的requirements.txt
文件如下:
sagemaker
boto3
pandas
s3fs
numpy
pathlib
带参数:
"C:\Program Files\Amazon\AWSSAMCLI\bin\sam.cmd" build --template C:\Users\------\PycharmProjects\AutomatedSageMakerTraining\template.yaml --build-dir C:\Users\------\PycharmProjects\AutomatedSageMakerTraining\.aws-sam\build --use-container AutomatedSageMakerEvaluation
2019-08-20 09:23:29 Starting Build inside a container
2019-08-20 09:23:30 Building resource 'AutomatedSageMakerEvaluation'
Fetching lambci/lambda:build-python3.6 Docker container image......
2019-08-20 09:23:32 Mounting C:\Users\------\PycharmProjects\AutomatedSageMakerTraining as /tmp/samcli/source:ro,delegated inside runtime container
Build Succeeded
Built Artifacts : ..\..\..\..\Users\------\PycharmProjects\AutomatedSageMakerTraining\.aws-sam\build
Built Template : ..\..\..\..\Users\------\PycharmProjects\AutomatedSageMakerTraining\.aws-sam\build\template.yaml
Commands you can use next
=========================
[*] Invoke Function: sam local invoke -t ..\..\..\..\Users\------\PycharmProjects\AutomatedSageMakerTraining\.aws-sam\build\template.yaml
[*] Package: sam package --s3-bucket <yourbucket> --template-file ..\..\..\..\Users\------\PycharmProjects\AutomatedSageMakerTraining\.aws-sam\build\template.yaml
Running PythonPipBuilder:ResolveDependencies
Running PythonPipBuilder:CopySource
无参数:
"C:\Program Files\Amazon\AWSSAMCLI\bin\sam.cmd" build --template C:\Users\------\PycharmProjects\AutomatedSageMakerTraining\template.yaml --build-dir C:\Users\------\PycharmProjects\AutomatedSageMakerTraining\.aws-sam\build AutomatedSageMakerEvaluation
2019-08-20 09:16:30 Building resource 'AutomatedSageMakerEvaluation'
2019-08-20 09:16:30 Running PythonPipBuilder:ResolveDependencies
Build Failed
Error: PythonPipBuilder:ResolveDependencies - {bcrypt==3.1.7(wheel), protobuf3-to-dict==0.1.5(sdist), fsspec==0.4.1(sdist), dockerpty==0.4.1(sdist), pycparser==2.19(sdist), texttable==0.9.1(sdist), pyyaml==3.13(wheel), cryptography==2.7(wheel), docopt==0.6.2(sdist), s3fs==0.3.3(sdist), pynacl==1.3.0(wheel), pywin32==224(wheel), pathlib==1.0.1(sdist), sagemaker==1.37.1(sdist)}
为了帮助调试此错误,我 运行 使用带有 --debug 参数的相同命令:
"C:\Program Files\Amazon\AWSSAMCLI\bin\sam.cmd" build --template C:\Users\------\PycharmProjects\AutomatedSageMakerTraining\template.yaml --build-dir C:\Users\------\PycharmProjects\AutomatedSageMakerTraining\.aws-sam\build AutomatedSageMakerEvaluation --debug
2019-08-20 09:30:14 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2019-08-20 09:30:14 Changing event name from before-call.apigateway to before-call.api-gateway
2019-08-20 09:30:14 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2019-08-20 09:30:14 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2019-08-20 09:30:14 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2019-08-20 09:30:14 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2019-08-20 09:30:14 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
2019-08-20 09:30:14 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2019-08-20 09:30:14 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
2019-08-20 09:30:14 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2019-08-20 09:30:14 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
2019-08-20 09:30:14 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2019-08-20 09:30:14 Changing event name from before-call.apigateway to before-call.api-gateway
2019-08-20 09:30:14 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2019-08-20 09:30:14 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2019-08-20 09:30:14 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2019-08-20 09:30:14 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2019-08-20 09:30:14 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
2019-08-20 09:30:14 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2019-08-20 09:30:14 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
2019-08-20 09:30:14 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2019-08-20 09:30:14 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
2019-08-20 09:30:14 Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2019-08-20 09:30:14 'build' command is called
2019-08-20 09:30:14 No Parameters detected in the template
2019-08-20 09:30:14 2 resources found in the template
2019-08-20 09:30:14 Found Serverless function with name='AutomatedSageMakerTraining' and CodeUri='.'
2019-08-20 09:30:14 Found Serverless function with name='AutomatedSageMakerEvaluation' and CodeUri='.'
2019-08-20 09:30:15 Building resource 'AutomatedSageMakerEvaluation'
2019-08-20 09:30:15 Loading workflow module 'aws_lambda_builders.workflows'
2019-08-20 09:30:15 Registering workflow 'PythonPipBuilder' with capability 'Capability(language='python', dependency_manager='pip', application_framework=None)'
2019-08-20 09:30:15 Registering workflow 'NodejsNpmBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm', application_framework=None)'
2019-08-20 09:30:15 Registering workflow 'RubyBundlerBuilder' with capability 'Capability(language='ruby', dependency_manager='bundler', application_framework=None)'
2019-08-20 09:30:15 Registering workflow 'GoDepBuilder' with capability 'Capability(language='go', dependency_manager='dep', application_framework=None)'
2019-08-20 09:30:15 Registering workflow 'GoModulesBuilder' with capability 'Capability(language='go', dependency_manager='modules', application_framework=None)'
2019-08-20 09:30:15 Registering workflow 'JavaGradleWorkflow' with capability 'Capability(language='java', dependency_manager='gradle', application_framework=None)'
2019-08-20 09:30:15 Registering workflow 'JavaMavenWorkflow' with capability 'Capability(language='java', dependency_manager='maven', application_framework=None)'
2019-08-20 09:30:15 Registering workflow 'DotnetCliPackageBuilder' with capability 'Capability(language='dotnet', dependency_manager='cli-package', application_framework=None)'
2019-08-20 09:30:15 Found workflow 'PythonPipBuilder' to support capabilities 'Capability(language='python', dependency_manager='pip', application_framework=None)'
2019-08-20 09:30:15 Running workflow 'PythonPipBuilder'
2019-08-20 09:30:15 Running PythonPipBuilder:ResolveDependencies
2019-08-20 09:30:15 calling pip download -r C:\Users\------\PycharmProjects\AutomatedSageMakerTraining\requirements.txt --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z
2019-08-20 09:31:20 Full dependency closure: {sagemaker==1.37.1(sdist), docker-pycreds==0.4.0(wheel), fsspec==0.4.1(sdist), setuptools==41.1.0(wheel), botocore==1.12.211(wheel), boto3==1.9.211(wheel), websocket-client==0.56.0(wheel), paramiko==2.6.0(wheel), docker==3.7.3(wheel), protobuf3-to-dict==0.1.5(sdist), scipy==1.3.1(wheel), cryptography==2.7(wheel), jmespath==0.9.4(wheel), six==1.12.0(wheel), pynacl==1.3.0(wheel), python-dateutil==2.8.0(wheel), docutils==0.15.2(wheel), chardet==3.0.4(wheel), docopt==0.6.2(sdist), requests==2.20.1(wheel), s3transfer==0.2.1(wheel), colorama==0.4.1(wheel), cached-property==1.5.1(wheel), asn1crypto==0.24.0(wheel), dockerpty==0.4.1(sdist), protobuf==3.9.1(wheel), jsonschema==2.6.0(wheel), pytz==2019.2(wheel), pywin32==224(wheel), certifi==2019.6.16(wheel), pyyaml==3.13(wheel), numpy==1.17.0(wheel), pycparser==2.19(sdist), idna==2.7(wheel), s3fs==0.3.3(sdist), pathlib==1.0.1(sdist), texttable==0.9.1(sdist), cffi==1.12.3(wheel), pypiwin32==223(wheel), pandas==0.25.0(wheel), urllib3==1.24.3(wheel), docker-compose==1.24.1(wheel), bcrypt==3.1.7(wheel)}
2019-08-20 09:31:20 initial compatible: {docker-pycreds==0.4.0(wheel), setuptools==41.1.0(wheel), botocore==1.12.211(wheel), boto3==1.9.211(wheel), websocket-client==0.56.0(wheel), paramiko==2.6.0(wheel), docker==3.7.3(wheel), jmespath==0.9.4(wheel), six==1.12.0(wheel), python-dateutil==2.8.0(wheel), chardet==3.0.4(wheel), docutils==0.15.2(wheel), requests==2.20.1(wheel), s3transfer==0.2.1(wheel), colorama==0.4.1(wheel), cached-property==1.5.1(wheel), asn1crypto==0.24.0(wheel), jsonschema==2.6.0(wheel), pytz==2019.2(wheel), certifi==2019.6.16(wheel), idna==2.7(wheel), pypiwin32==223(wheel), urllib3==1.24.3(wheel), docker-compose==1.24.1(wheel)}
2019-08-20 09:31:20 initial incompatible: {pyyaml==3.13(wheel), numpy==1.17.0(wheel), protobuf3-to-dict==0.1.5(sdist), scipy==1.3.1(wheel), pycparser==2.19(sdist), sagemaker==1.37.1(sdist), s3fs==0.3.3(sdist), pathlib==1.0.1(sdist), cryptography==2.7(wheel), fsspec==0.4.1(sdist), texttable==0.9.1(sdist), dockerpty==0.4.1(sdist), protobuf==3.9.1(wheel), cffi==1.12.3(wheel), pynacl==1.3.0(wheel), pandas==0.25.0(wheel), docopt==0.6.2(sdist), pywin32==224(wheel), bcrypt==3.1.7(wheel)}
2019-08-20 09:31:20 Downloading missing wheels: {pyyaml==3.13(wheel), numpy==1.17.0(wheel), protobuf3-to-dict==0.1.5(sdist), pycparser==2.19(sdist), scipy==1.3.1(wheel), sagemaker==1.37.1(sdist), s3fs==0.3.3(sdist), pathlib==1.0.1(sdist), cryptography==2.7(wheel), fsspec==0.4.1(sdist), texttable==0.9.1(sdist), dockerpty==0.4.1(sdist), protobuf==3.9.1(wheel), cffi==1.12.3(wheel), pynacl==1.3.0(wheel), pandas==0.25.0(wheel), docopt==0.6.2(sdist), pywin32==224(wheel), bcrypt==3.1.7(wheel)}
2019-08-20 09:31:20 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z pyyaml==3.13
2019-08-20 09:31:21 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z numpy==1.17.0
2019-08-20 09:31:27 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z protobuf3-to-dict==0.1.5
2019-08-20 09:31:28 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z pycparser==2.19
2019-08-20 09:31:29 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z scipy==1.3.1
2019-08-20 09:31:39 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z sagemaker==1.37.1
2019-08-20 09:31:40 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z s3fs==0.3.3
2019-08-20 09:31:41 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z pathlib==1.0.1
2019-08-20 09:31:42 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z cryptography==2.7
2019-08-20 09:31:44 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z fsspec==0.4.1
2019-08-20 09:31:45 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z texttable==0.9.1
2019-08-20 09:31:46 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z dockerpty==0.4.1
2019-08-20 09:31:47 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z protobuf==3.9.1
2019-08-20 09:31:49 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z cffi==1.12.3
2019-08-20 09:31:51 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z pynacl==1.3.0
2019-08-20 09:31:52 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z pandas==0.25.0
2019-08-20 09:32:01 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z docopt==0.6.2
2019-08-20 09:32:02 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\-------\AppData\Local\Temp\tmpnbl_t57z pywin32==224
2019-08-20 09:32:03 calling pip download --only-binary=:all: --no-deps --platform manylinux1_x86_64 --implementation cp --abi cp36m --dest C:\Users\------\AppData\Local\Temp\tmpnbl_t57z bcrypt==3.1.7
2019-08-20 09:32:04 compatible wheels after second download pass: {docker-pycreds==0.4.0(wheel), setuptools==41.1.0(wheel), botocore==1.12.211(wheel), boto3==1.9.211(wheel), websocket-client==0.56.0(wheel), paramiko==2.6.0(wheel), docker==3.7.3(wheel), scipy==1.3.1(wheel), jmespath==0.9.4(wheel), six==1.12.0(wheel), python-dateutil==2.8.0(wheel), docutils==0.15.2(wheel), chardet==3.0.4(wheel), requests==2.20.1(wheel), s3transfer==0.2.1(wheel), colorama==0.4.1(wheel), cached-property==1.5.1(wheel), asn1crypto==0.24.0(wheel), protobuf==3.9.1(wheel), jsonschema==2.6.0(wheel), pytz==2019.2(wheel), certifi==2019.6.16(wheel), numpy==1.17.0(wheel), idna==2.7(wheel), cffi==1.12.3(wheel), pypiwin32==223(wheel), pandas==0.25.0(wheel), urllib3==1.24.3(wheel), docker-compose==1.24.1(wheel)}
2019-08-20 09:32:04 Build missing wheels from sdists (C compiling True): {protobuf3-to-dict==0.1.5(sdist), pycparser==2.19(sdist), sagemaker==1.37.1(sdist), s3fs==0.3.3(sdist), pathlib==1.0.1(sdist), fsspec==0.4.1(sdist), texttable==0.9.1(sdist), dockerpty==0.4.1(sdist), docopt==0.6.2(sdist)}
2019-08-20 09:32:04 calling pip wheel --no-deps --wheel-dir C:\Users\-------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\protobuf3-to-dict-0.1.5.tar.gz
2019-08-20 09:32:07 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\pycparser-2.19.tar.gz
2019-08-20 09:32:10 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\sagemaker-1.37.1.tar.gz
2019-08-20 09:32:13 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\s3fs-0.3.3.tar.gz
2019-08-20 09:32:16 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\pathlib-1.0.1.tar.gz
2019-08-20 09:32:18 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\fsspec-0.4.1.tar.gz
2019-08-20 09:32:20 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\texttable-0.9.1.tar.gz
2019-08-20 09:32:23 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\dockerpty-0.4.1.tar.gz
2019-08-20 09:32:25 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\docopt-0.6.2.tar.gz
2019-08-20 09:32:28 compatible after building wheels (no C compiling): {docker-pycreds==0.4.0(wheel), setuptools==41.1.0(wheel), botocore==1.12.211(wheel), boto3==1.9.211(wheel), websocket-client==0.56.0(wheel), paramiko==2.6.0(wheel), docker==3.7.3(wheel), scipy==1.3.1(wheel), jmespath==0.9.4(wheel), six==1.12.0(wheel), python-dateutil==2.8.0(wheel), docutils==0.15.2(wheel), chardet==3.0.4(wheel), requests==2.20.1(wheel), s3transfer==0.2.1(wheel), colorama==0.4.1(wheel), cached-property==1.5.1(wheel), asn1crypto==0.24.0(wheel), protobuf==3.9.1(wheel), jsonschema==2.6.0(wheel), pytz==2019.2(wheel), certifi==2019.6.16(wheel), numpy==1.17.0(wheel), idna==2.7(wheel), cffi==1.12.3(wheel), pypiwin32==223(wheel), pandas==0.25.0(wheel), urllib3==1.24.3(wheel), docker-compose==1.24.1(wheel)}
2019-08-20 09:32:28 Build missing wheels from sdists (C compiling False): {protobuf3-to-dict==0.1.5(sdist), pycparser==2.19(sdist), sagemaker==1.37.1(sdist), s3fs==0.3.3(sdist), pathlib==1.0.1(sdist), fsspec==0.4.1(sdist), texttable==0.9.1(sdist), dockerpty==0.4.1(sdist), docopt==0.6.2(sdist)}
2019-08-20 09:32:28 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\protobuf3-to-dict-0.1.5.tar.gz
2019-08-20 09:32:28 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\pycparser-2.19.tar.gz
2019-08-20 09:32:28 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\sagemaker-1.37.1.tar.gz
2019-08-20 09:32:28 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\s3fs-0.3.3.tar.gz
2019-08-20 09:32:28 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\pathlib-1.0.1.tar.gz
2019-08-20 09:32:28 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\fsspec-0.4.1.tar.gz
2019-08-20 09:32:28 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\texttable-0.9.1.tar.gz
2019-08-20 09:32:28 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\dockerpty-0.4.1.tar.gz
2019-08-20 09:32:28 calling pip wheel --no-deps --wheel-dir C:\Users\------\AppData\Local\Temp\tmpnbl_t57z C:\Users\------\AppData\Local\Temp\tmpnbl_t57z\docopt-0.6.2.tar.gz
2019-08-20 09:32:28 compatible after building wheels (C compiling): {docker-pycreds==0.4.0(wheel), setuptools==41.1.0(wheel), botocore==1.12.211(wheel), boto3==1.9.211(wheel), websocket-client==0.56.0(wheel), paramiko==2.6.0(wheel), docker==3.7.3(wheel), scipy==1.3.1(wheel), jmespath==0.9.4(wheel), six==1.12.0(wheel), python-dateutil==2.8.0(wheel), docutils==0.15.2(wheel), chardet==3.0.4(wheel), requests==2.20.1(wheel), s3transfer==0.2.1(wheel), colorama==0.4.1(wheel), cached-property==1.5.1(wheel), asn1crypto==0.24.0(wheel), protobuf==3.9.1(wheel), jsonschema==2.6.0(wheel), pytz==2019.2(wheel), certifi==2019.6.16(wheel), numpy==1.17.0(wheel), idna==2.7(wheel), cffi==1.12.3(wheel), pypiwin32==223(wheel), pandas==0.25.0(wheel), urllib3==1.24.3(wheel), docker-compose==1.24.1(wheel)}
2019-08-20 09:32:28 Final compatible: {cached-property==1.5.1(wheel), docker-pycreds==0.4.0(wheel), asn1crypto==0.24.0(wheel), setuptools==41.1.0(wheel), protobuf==3.9.1(wheel), botocore==1.12.211(wheel), jsonschema==2.6.0(wheel), pytz==2019.2(wheel), boto3==1.9.211(wheel), certifi==2019.6.16(wheel), websocket-client==0.56.0(wheel), paramiko==2.6.0(wheel), urllib3==1.24.3(wheel), docker==3.7.3(wheel), numpy==1.17.0(wheel), scipy==1.3.1(wheel), idna==2.7(wheel), chardet==3.0.4(wheel), jmespath==0.9.4(wheel), six==1.12.0(wheel), cffi==1.12.3(wheel), pypiwin32==223(wheel), python-dateutil==2.8.0(wheel), docutils==0.15.2(wheel), requests==2.20.1(wheel), pandas==0.25.0(wheel), docker-compose==1.24.1(wheel), s3transfer==0.2.1(wheel), colorama==0.4.1(wheel)}
2019-08-20 09:32:28 Final incompatible: {pyyaml==3.13(wheel), numpy==1.17.0(wheel), scipy==1.3.1(wheel), cryptography==2.7(wheel), protobuf==3.9.1(wheel), cffi==1.12.3(wheel), pynacl==1.3.0(wheel), pandas==0.25.0(wheel), pywin32==224(wheel), bcrypt==3.1.7(wheel)}
2019-08-20 09:32:28 Final missing wheels: {pyyaml==3.13(wheel), protobuf3-to-dict==0.1.5(sdist), pycparser==2.19(sdist), sagemaker==1.37.1(sdist), s3fs==0.3.3(sdist), pathlib==1.0.1(sdist), cryptography==2.7(wheel), fsspec==0.4.1(sdist), texttable==0.9.1(sdist), dockerpty==0.4.1(sdist), pynacl==1.3.0(wheel), docopt==0.6.2(sdist), pywin32==224(wheel), bcrypt==3.1.7(wheel)}
2019-08-20 09:32:55 PythonPipBuilder:ResolveDependencies failed
Traceback (most recent call last):
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\workflows\python_pip\actions.py", line 39, in execute
self.scratch_dir
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\workflows\python_pip\packager.py", line 143, in build_dependencies
requirements_path, artifacts_dir_path, scratch_dir_path)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\workflows\python_pip\packager.py", line 212, in build_site_packages
raise MissingDependencyError(packages_without_wheels)
aws_lambda_builders.workflows.python_pip.packager.MissingDependencyError: {pyyaml==3.13(wheel), protobuf3-to-dict==0.1.5(sdist), pycparser==2.19(sdist), sagemaker==1.37.1(sdist), s3fs==0.3.3(sdist), pathlib==1.0.1(sdist), cryptography==2.7(wheel), fsspec==0.4.1(sdist), texttable==0.9.1(sdist), dockerpty==0.4.1(sdist), pynacl==1.3.0(wheel), docopt==0.6.2(sdist), pywin32==224(wheel), bcrypt==3.1.7(wheel)}
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\workflow.py", line 248, in run
action.execute()
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\workflows\python_pip\actions.py", line 42, in execute
raise ActionFailedError(str(ex))
aws_lambda_builders.actions.ActionFailedError: {pyyaml==3.13(wheel), protobuf3-to-dict==0.1.5(sdist), pycparser==2.19(sdist), sagemaker==1.37.1(sdist), s3fs==0.3.3(sdist), pathlib==1.0.1(sdist), cryptography==2.7(wheel), fsspec==0.4.1(sdist), texttable==0.9.1(sdist), dockerpty==0.4.1(sdist), pynacl==1.3.0(wheel), docopt==0.6.2(sdist), pywin32==224(wheel), bcrypt==3.1.7(wheel)}
Build Failed
2019-08-20 09:32:55 Sending Telemetry: {'metrics': [{'commandRun': {'awsProfileProvided': False, 'debugFlagProvided': True, 'region': '', 'commandName': 'sam build', 'duration': 160781, 'exitReason': 'UserException', 'exitCode': 1, 'requestId': '943b9308-c11b-43e0-9d6d-5bbc984946ad', 'installationId': '0c5d4463-668a-4706-ae40-afd0704d66bd', 'sessionId': '4736e025-2966-4a4b-aeb6-2702fe347779', 'executionEnvironment': 'CLI', 'pyversion': '3.6.7', 'samcliVersion': '0.19.0'}}]}
2019-08-20 09:32:55 Starting new HTTPS connection (1): aws-serverless-tools-telemetry.us-west-2.amazonaws.com:443
2019-08-20 09:32:56 HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)
Error: PythonPipBuilder:ResolveDependencies - {pyyaml==3.13(wheel), protobuf3-to-dict==0.1.5(sdist), pycparser==2.19(sdist), sagemaker==1.37.1(sdist), s3fs==0.3.3(sdist), pathlib==1.0.1(sdist), cryptography==2.7(wheel), fsspec==0.4.1(sdist), texttable==0.9.1(sdist), dockerpty==0.4.1(sdist), pynacl==1.3.0(wheel), docopt==0.6.2(sdist), pywin32==224(wheel), bcrypt==3.1.7(wheel)}
似乎出于某种原因,当未设置 --use-container 参数时它无法解析兼容的依赖项。
幸运的是,我能够通过将 template.yaml 部署为无服务器 (CloudFormation) 应用程序,将 Lambda 函数部署到容器内的 AWS,如果我不选中此框,它也会失败。
请检查您的 requirements.txt 文件,我遇到了同样的问题,但我注意到该文件有一个输入 <-|在文件的最后,祝你好运。
我不知道为什么这适用于 --use-container
,但我遇到了同样的问题,而且似乎没有其他人回答这个问题。
您尝试使用的某些库似乎缺少 wheel 文件。它实际上在调试消息中是这样说的,但是如果您不知道要查找什么,则不容易找到。在 https://pythonwheels.com/.
了解更多关于轮子的信息所以,经过几个小时的挖掘,我 运行 在终端中输入以下命令:
pip install wheel
之后,我可以在本地构建、调用函数,并在没有 --use-container
参数的情况下部署到 AWS。
我有同样的问题,特别是 psycopg2
,pip install wheel
或 --use-container
没有帮助。
我所做的是安装有问题的包的二进制版本 pip install psycopg2-binary
,并且还在 requirements.txt
文件中包含 psycopg2-binary
。
这解决了我的问题,希望对您有所帮助。
根据您的特定 dependency/dependencies,一种可能有效或无效的解决方法是 使用您的问题 dependency/dependencies 可能存在的先前版本之一,因此可能 (a) 具有较旧的依赖项,这些依赖项可能在 PyPI 上有轮子或 (b) 缺少有问题的依赖项。
例如,PythonPipBuilder:ResolveDependencies
错误是由 jsonschema==3.2.0
引发的,因为它依赖于 pyrsistent
目前在 PyPI 上没有轮子。但是,jsonschema==2.6.0
不会产生错误,因为它不依赖于 pyrsistent
.
我在使用 python3.8.8
时遇到了同样的问题,安装了 pyenv
。我还在调试输出中发现了关于 wheel
的提示,但它已经安装了。
我可以通过升级 pip
来修复它:
/Users/xyz/.pyenv/versions/3.8.8/bin/python3.8 -m pip install --upgrade pip
正如其他人所提到的,某些软件包版本可能缺少 wheel 文件。在我的例子中,依赖树中某处的包的新版本是罪魁祸首。 我为解决这个问题所做的是将该包的先前版本明确添加到我的 requirements.txt 文件中。
所以收到后Error: PythonPipBuilder:ResolveDependencies - {greenlet==1.1.0(wheel)}
我将 greenlet==1.0.0
添加到我的需求文件中。