SAM Build успешно завершается только с параметром --use-container

Я разрабатываю функцию Lambda, написанную на python3.6, для локального тестирования, а затем развертываю ее на AWS после работы. Для этого я использую PyCharm AWS Serverless Toolkit.

Сборка 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.

К счастью, я могу развернуть функции Lambda на AWS внутри контейнера, развернув template.yaml как бессерверное (CloudFormation) приложение. Если я не установлю этот флажок, это тоже не сработает. Щелкните правой кнопкой мыши template.yaml  Выбрать функцию сборки внутри контейнера


person OscarVanL    schedule 20.08.2019    source источник


Ответы (6)


У меня нет объяснения, ПОЧЕМУ это работает с --use-container, но у меня была та же проблема, и никто другой, похоже, не отвечает на это.

Похоже, что в некоторых библиотеках, которые вы пытаетесь использовать, отсутствуют файлы колес. На самом деле об этом говорится в сообщении отладки, но его нелегко найти, если вы не знаете, что ищете. Подробнее о колесах см. https://pythonwheels.com/.

Итак, после нескольких часов копания я выполнил в терминале следующую команду:

pip install wheel

После этого я мог собрать, вызвать функцию локально и развернуть в AWS без параметра --use-container.

person petrapower    schedule 07.11.2019
comment
Это все еще ответ для aws-sam-cli v0.40.0; Причина в том, что пакет aws-lambda-builders, который управляет процессом загрузки пакетов, ищет для каждой зависимости колесо, построенное под Linux; когда для данного пакета его нет, он пытается построить колесо из необработанного кода sdist - для этого требуется пакет wheel, который не установлен как зависимость SAM. Вам придется установить его самостоятельно. - person Darian Moody; 02.02.2020

Один обходной путь, который может работать или не работать в зависимости от вашей конкретной зависимости / зависимостей, - это использовать одну из, возможно, существующих предыдущих версий вашей проблемной зависимости / зависимостей, которые, как следствие, могут (а) иметь более старые зависимости которые могут иметь колеса на PyPI или (б) не иметь проблемных зависимостей.

Например, ошибка PythonPipBuilder:ResolveDependencies возникает с jsonschema==3.2.0, потому что она зависит от pyrsistent, у которого в настоящее время нет колес на PyPI. Однако ошибка не возникает с jsonschema==2.6.0, потому что она не зависит от pyrsistent.

person tuomastik    schedule 22.10.2020

У меня была такая же проблема, особенно с psycopg2, и pip install wheel или --use-container не помогли.

Вместо этого я установил двоичную версию рассматриваемого пакета pip install psycopg2-binary, а также включил psycopg2-binary в файл requirements.txt.

Это решило мою проблему, надеюсь, поможет.

person Nima Maleki    schedule 11.05.2020

У меня такая же проблема при использовании python3.8.8, установленного с pyenv. Я также нашел подсказку о wheel в выводе отладки, но она уже была установлена.

Мне удалось исправить это, обновив pip:

/Users/xyz/.pyenv/versions/3.8.8/bin/python3.8 -m pip install --upgrade pip
person Marius    schedule 19.03.2021

Пожалуйста, проверьте свой файл requirements.txt, у меня была та же проблема, но я заметил, что в файле есть ввод ‹- | в конце файла удачи.

person javier ortiz    schedule 04.10.2019

Как уже упоминалось, в некоторых версиях пакетов могут отсутствовать файлы колес. В моем случае виновником была новая версия пакета где-то в дереве зависимостей. Чтобы решить эту проблему, я явно добавил предыдущую версию этого пакета в свой файл requirements.txt.

так что после получения Error: PythonPipBuilder:ResolveDependencies - {greenlet==1.1.0(wheel)}

Я добавил greenlet==1.0.0 в свой файл требований.

person Roey B    schedule 08.05.2021