As it is described in the Amazon official documentation link here It is as simple as just creating a zip of all the folder contents after installing the required packages in your folder where you have your python lambda code.
As Vineeth pointed above in his comment, The very first step in moving from an inline code editor to a zip file upload approach is to change your lambda function handler name under configuration settings to include the python script file name that holds the lambda handler.
lambda_handler => {your-python-script-file-name}.lambda_handler.

Other solutions like python-lambda and lambda-uploader help with simplifying the process of uploading and the most importantly LOCAL TESTING. These will save a lot of time in development.
Answer from Santhosh Gandhe on Stack Overflowamazon web services - How do I add python libraries to an AWS lambda function for Alexa? - Stack Overflow
amazon web services - AWS lambda building external dependency libraries in python - Stack Overflow
What's the fastest way to package requirements for a Lambda Function?
How can I add third party python dependencies to a Lambda function?
Videos
As it is described in the Amazon official documentation link here It is as simple as just creating a zip of all the folder contents after installing the required packages in your folder where you have your python lambda code.
As Vineeth pointed above in his comment, The very first step in moving from an inline code editor to a zip file upload approach is to change your lambda function handler name under configuration settings to include the python script file name that holds the lambda handler.
lambda_handler => {your-python-script-file-name}.lambda_handler.

Other solutions like python-lambda and lambda-uploader help with simplifying the process of uploading and the most importantly LOCAL TESTING. These will save a lot of time in development.
The official documentation is pretty good. In a nutshell, you need to create a zip file of a directory containing both the code of your lambda function and all external libraries you use at the top level.
You can simulate that by deactivating your virtualenv, copying all your required libraries into the working directory (which is always in sys.path if you invoke a script on the command line), and checking whether your script still works.
I am dynamically creating lambda functions based on different requirements.txt and code supplied.
sometimes the requirements.txt changes and sometimes the code supplied changes.
currently i have a disguisting process of creating a venv then pip installing everything to a folder, zipping it up and send it to s3 and providing that s3 object zip file to my lambda for creation.
its really gross, especially if i want to modify the code i download it, unzip it, then compare and then zip it again then merge.
there HAS to be a better way, how are folks doing it?
EDIT: Wrote a quick script to test containerizing the code and useing ECS then sending the image url to lambda: https://github.com/esteininger/aws-docker-ecr-lambda/blob/main/ecr.py
unfortunately it's still much slower than zipping locally.