简体   繁体   中英

aws sam build not able to build packages which require paramiko due to "Error: PythonPipBuilder:ResolveDependencies"

I've been learning the ropes with AWS SAM and have successfully deployed a number of lambdas together with dependencies and other AWS services. However, I seem to have run into a problem when trying to deploy a lambda which relies on some specific dependencies.

Here is my requirements.txt file:

paramiko==2.4.2
cryptography==2.6.1
bcrypt==3.1.6
pynacl==1.3.0

This file is found in "packageRoot/myCodeUri/requirements.txt"

When I run sam build I get the following error:

2019-08-27 11:18:18 Running PythonPipBuilder:ResolveDependencies

Build Failed
Error: PythonPipBuilder:ResolveDependencies - {pynacl==1.3.0(wheel), cryptography==2.6.1(wheel), bcrypt==3.1.6(wheel)}

This (or at least similar) errors have been reported: here over 8 months ago but is currently not answered.

PS I tried this originally with just paramiko as this is the only library my script uses, as I understood; the dependencies should be automatically pulled in during the build, however this didn't work either.

Any help would be great?

I was getting same error with another dependency while running sam build . I was able to resolve this by installing wheel in our python (or venv) environment.

pip install wheel

This approach did not require --use-container flag while running sam build

I've managed to get a workaround to build and deploy lambdas that need the paramiko library using a docker container in interactive mode. Anyone having the same problem have a look here

安装wheel对我不起作用,但是升级 pip 可以。

python -m pip install --upgrade pip

I had this issue when trying to use simplejson library. It was added to solve serialization issues... (pip wheel and upgrade didn't help), I just deleted the library and handle the serialization issues within the db query)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM