I guess many people have come across the same issue. I have tried to find every possible blog and try every method. I have reached this point and stuck here.
I am using Serverless framework and virtualenv.
serverless.yml:
service: test-pandas
provider:
name: aws
runtime: python2.7
plugins:
- serverless-python-requirements
package:
exclude:
- venv/**
- node_modules/**
functions:
hello:
handler: validation.hello
validation.py:
import pandas as pd
import numpy as np
def hello(event, context):
return "hello world"
I am using python 2.7. I have run these commands in Virtualenv:
virtualenv venv --python=python2
source venv/bin/activate
pip install pandas
pip freeze > requirements.txt
cat requirements.txt
Before creating the requirements.txt, the error was "No import module named pandas" and after I setup serverless-python-requirements, I am getting "Missing required dependencies ['numpy']".
Am I missing something here?
numpy? surprised pandas didn't install it as a dependency, but ...