Python Deployment Package with SKLEARN, PANDAS and NUMPY issue? Python Deployment Package with SKLEARN, PANDAS and NUMPY issue? pandas pandas

Python Deployment Package with SKLEARN, PANDAS and NUMPY issue?


u are using python 3.6 .so pip3 install numpyshould be used, make a try .


You need to make sure all the dependent libraries AND the Python file containing your function are all in one zip file in order for it to detect the correct dependencies.

So essentially, you will need to have Numpy, Panda and your own files all in one zip file before you upload it. Also make sure that your code is referring to the local files (in the same unzipped directory) as dependencies. If you have done that already, the issue is probably how your included libraries gets referenced. Make sure you are able to use the included libraries as a dependency by getting the correct relative path on AWS once it's deployed to Lambda.


So like Wai kin chung said, you need to use pip3 to install the libraries.

so to figure out which python version is default you can type:

which python

or

python -v

So in order to install with python3 you need to type:

python3 -m pip install sklearn, pandas, numpy --user

Once that is done, you can make sure that the packages are installed with:

python3 -m pip freeze

This will show all the python libraries installed with your python model. Once you have the libraries you would want to continue with you regular steps. Of course you would first want to delete everything that you have placed in ~/venv/lib/python3.6/site-packages/*.

cd ~/lambda_codezip -r9 ~/package.zip