Unable to use this package in AWS Lambda Function
GopalakrishnanK opened this issue · comments
I get this error when i try to use it in lambda "Unable to import module 'lambda_function': No module named _mysql". Any suggessions?
That is a dependency we take. It also happens to be a c dependency - so you are going to need to bundle dependencies in such a way that the c dependency works in lambda. I am not sure how to do that. Bundling dependencies is out of scope of this library though. I suggest looking into how Lambda recommends bundling dependencies especially when they are compiled.
Trying to use it with Python 3.5.4 and mysqlclient 1.4.2 getting the same error. Do you have a work around? I managed it like
try:
import pymysql
pymysql.install_as_MySQLdb()
except ImportError as e:
print(e)
import _mysql
It works but now it is throwing error on Line 158 in Database.py:
self._result = self._db.store_result()
AttributeError: 'Connection' object has no attribute 'store_result'