0

I am trying to zip python 2.7 code with pandas and cassandra libraries on my local windows 7 computer. From the anaconda prompt I did pip install -t 'folder location' for both pandas and cassandra and I zipped the contents - not the folder. I am getting the error Unable to import module 'lambda_function': Missing required dependencies ['numpy']. However, pandas included numpy as a dependency and it is in the zip file. zip file contents

I researched this isssue, and found Pandas & AWS Lambda the marked answer says: All static packages have to be compiled on an EC2 Amazon Linux instance.

This article that was referenced in another question Problems using MySQL with AWS Lambda in Python says to use EC2 Amazon linux and virtualenv: http://www.perrygeo.com/running-python-with-compiled-code-on-aws-lambda.html

Does this mean I am having problems because I am using my local windows 7 computer, is it required to use EC2 Amazon linux?

Community
  • 1
  • 1
red79phoenix
  • 91
  • 3
  • 14
  • What happens with you do use an EC2 Amazon Linux instance? – Loaf Jun 01 '18 at 17:06
  • Can't you just `git checkout` on the linux instance instead of zipping it and emailing it to yourself? – Jim Jun 02 '18 at 04:22
  • @Loaf I don't have an Amazon Linux EC2 instance provisioned. I guess I will work on that. Jim - I am zipping it and uploading to S3 and then bringing it into AWS Lambda. – red79phoenix Jun 04 '18 at 13:53
  • @red79phoenix you should be able to utilize the Free Tier for this, so there will be no charges. – Loaf Jun 04 '18 at 13:57

1 Answers1

0

I believe the answer to my question is Yes, you do have to use EC2 Amazon Linux. I found this post on the AWS forum regarding the Cassandra-Driver library: https://forums.aws.amazon.com/thread.jspa?threadID=247496

I was a little unsure about how to do this but I found a great tutorial from AWS: https://docs.aws.amazon.com/lambda/latest/dg/with-s3-example-deployment-pkg.html

I followed the instructions and created a virtualenv and downloaded everything - seems to be working. I got past that error but now it is unable to download from S3, I will create a new thread for that.

red79phoenix
  • 91
  • 3
  • 14