How do I get p4python to work in AWS Lambda using Python 3.12

53 Views Asked by At

I am trying to write a an AWS lambda that imports the P4Python package. I currently have the lambda working in Python 3.9 but would like to upgrade it to 3.12.

To get it to work in python 3.9 I had to specify the version p4python==2021.1.2265002 in the requirements.txt file, as any later versions did not work. I believe this is due to the sam build process requesting binaries for manylinux2014_x86_64, it seems like later versions of p4python only ship with binaries targeting more recent versions of manylinux.

When trying to build targeting python 3.12 sam build seems to run this command (which works for the version I specified above in python 3.9)

| calling pip download --only-binary=:all: --no-deps --platform manylinux2014_x86_64 --implementation cp --abi cp312 --dest C:\Users\JHunt\AppData\Local\Temp\tmpj7_8oizi p4python==2023.2.2527637

My assumption based on looking at the available wheels on PyPI is that there isn't a version compatible with manylinux2014 and that's why it doesn't work.

As a Windows user this has mostly just been guesswork so it would be good to know if my assumptions are correct and if there's anything that can be done. It seems odd to me that AWS lambdas would be using a 10 year old version of linux

0

There are 0 best solutions below