How to build a Python project for a specific version of Python

0 votes

I have an app that I would like to deploy to AWS Lambda and for this reason it has to have Python 3.9.

I have the following in the pyproject.toml:

name = "app"
readme = ""
requires-python = "<=3.9"
version = "0.5.4"

If I try to pip install all the dependencies I get the following error:

ERROR: Package 'app' requires a different Python: 3.11.1 not in '<=3.9'

Is there a way to specify the Python version for this module?

I see there is a lot of confusion about this. I simply want to specify 3.9 "globally" for my build. So when I build the layer for the lambda with the following command it runs:

pip install . -t pyhon/

Right now it has only Python 3.11 packaged. For example:

❯ ls -larth python/ | grep sip

When I try to use the layer created this way it fails to load the required library.

Feb 16 in AWS by sarit
• 1,190 points

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In AWS

0 votes
3 answers
0 votes
1 answer

How to Restrict AWS Resource Access to a Specific IAM Role

You can use iam get-role to find the Role-Id and add ...READ MORE

answered Aug 13, 2018 in AWS by Archana
• 4,170 points
0 votes
1 answer

How to set up a SPF(Sender Policy Framework) for AWS EC2 instance?

Setting up a SPF record is pretty ...READ MORE

answered Aug 16, 2018 in AWS by Archana
• 4,170 points
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 3,471 views
0 votes
1 answer
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP