2
votes

I'm currently trying to launch a Lambda as a Zappa (Python3.6). After deploying the app / configuring everything on the AWS-side, I ran the following command to test the app in my local environment,

zappa invoke production script.main

And got this error,

/tmp/virtualenv_name/pymssql.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PyFPE_jbuf: ImportError

Traceback (most recent call last): File "/var/task/handler.py", line 509, in lambda_handler return LambdaHandler.lambda_handler(event, context)

File "/var/task/handler.py", line 237, in lambda_handler handler = cls()

File "/var/task/handler.py", line 129, in init self.app_module = importlib.import_module(self.settings.APP_MODULE)

File "/var/lang/lib/python3.6/importlib/init.py", line 126, in >import_module return _bootstrap._gcd_import(name[level:], package, level)

File "frozen importlib._bootstrap", line 978, in _gcd_import

File "frozen importlib._bootstrap", line 961, in _find_and_load

File "frozen importlib._bootstrap", line 950, in _find_and_load_unlocked

File "frozen importlib._bootstrap", line 655, in _load_unlocked

File "frozen importlib._bootstrap_external>", line 678, in exec_module

File "frozen importlib._bootstrap", line 205, in _call_with_frames_removed

File "/tmp/virtualenv_name/script.py", line 3, in > module

import pymssql

ImportError: /tmp/virtualenv_name/pymssql.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PyFPE_jbuf

Most of the issues with PyFPE_jbuf that I've read about seem to involve multiple installations of a certain dependency, but none of the solutions seem to apply here. So far I've tried,

  1. Un-installing and re-installing pymssql in my virtual environment, and running zappa update.
  2. Un-installing and re-installing other packages/libraries that contain pymssql (like sqlalchemy), and running zappa update.
  3. Un-deploying the project, doing 1 and 2, then re-deploying it.
  4. Un-installing and re-installing cython in my virtual environment, and running zappa update.

    Is my understanding of this error correct? Any suggestions for troubleshooting? Fixes?

Thanks!

1

1 Answers

2
votes

I faced a similar problem while trying to install dragnet and spacy in an anaconda environment. I believe pip install was using a cached file that was compiled using another gcc version. What solved my problem was uninstalling the library and then reinstalling it using the --no-cache-dir flag, ex. pip install dragnet --no-cache-dir which built the package from scratch by running the setup.py for the new environment.

Also note that you might need to run sudo apt install libxml2-dev libxslt-dev python-dev for the build to be successful (at least for dragnet and spacy, but you might need something else)