'Deploy keras model to google app engine - ImportError: libBLT.2.5.so.8.6: cannot open shared object file: No such file or directory

I'm trying to deploy a Flask App to Google Cloud's App Engine, however once the App is deployed and starts booting I receive the following error:

ImportError: libBLT.2.5.so.8.6: cannot open shared object file: No such file or directory

How can I figure out which shared object file this is referring to? How can I fix this?

For reference, this is the error log:

        Updating service [default] (this may take several minutes)...failed.                                             
        ERROR: (gcloud.app.deploy) Error Response: [9] 
        Application startup error:
        [2018-05-01 13:06:35 +0000] [1] [INFO] Starting gunicorn 19.8.1
        [2018-05-01 13:06:35 +0000] [1] [INFO] Listening at: http://0.0.0.0:8080 (1)
        [2018-05-01 13:06:35 +0000] [1] [INFO] Using worker: sync
        [2018-05-01 13:06:35 +0000] [7] [INFO] Booting worker with pid: 7
        /env/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
          from ._conv import register_converters as _register_converters
        Using TensorFlow backend.
        [2018-05-01 13:06:42 +0000] [7] [ERROR] Exception in worker process
        Traceback (most recent call last):
          File "/env/lib/python3.6/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
            worker.init_process()
          File "/env/lib/python3.6/site-packages/gunicorn/workers/base.py", line 129, in init_process
            self.load_wsgi()
          File "/env/lib/python3.6/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
            self.wsgi = self.app.wsgi()
          File "/env/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi
            self.callable = self.load()
          File "/env/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
            return self.load_wsgiapp()
          File "/env/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
            return util.import_app(self.app_uri)
          File "/env/lib/python3.6/site-packages/gunicorn/util.py", line 350, in import_app
            __import__(module)
          File "/home/vmagent/app/app.py", line 44, in <module>
            from load import *
          File "/home/vmagent/app/model/load.py", line 12, in <module>
            from mrcnn import visualize
          File "/home/vmagent/app/RCNN/mrcnn/visualize.py", line 19, in <module>
            import matplotlib.pyplot as plt
          File "/env/lib/python3.6/site-packages/matplotlib/pyplot.py", line 115, in <module>
            _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
          File "/env/lib/python3.6/site-packages/matplotlib/backends/__init__.py", line 62, in pylab_setup
            [backend_name], 0)
          File "/env/lib/python3.6/site-packages/matplotlib/backends/backend_tkagg.py", line 4, in <module>
            from . import tkagg  # Paint image to Tk photo blitter extension.
          File "/env/lib/python3.6/site-packages/matplotlib/backends/tkagg.py", line 5, in <module>
            from six.moves import tkinter as Tk
          File "/env/lib/python3.6/site-packages/six.py", line 92, in __get__
            result = self._resolve()
          File "/env/lib/python3.6/site-packages/six.py", line 115, in _resolve
            return _import_module(self.mod)
          File "/env/lib/python3.6/site-packages/six.py", line 82, in _import_module
            __import__(name)
          File "/opt/python3.6/lib/python3.6/tkinter/__init__.py", line 36, in <module>
            import _tkinter # If this fails your Python may not be configured for Tk
        ImportError: libBLT.2.5.so.8.6: cannot open shared object file: No such file or directory
        [2018-05-01 13:06:42 +0000] [7] [INFO] Worker exiting (pid: 7)
        [2018-05-01 13:06:42 +0000] [1] [INFO] Shutting down: Master
        [2018-05-01 13:06:42 +0000] [1] [INFO] Reason: Worker failed to boot.


Solution 1:[1]

Interestingly the issue for me was this import coming from https://docs.python.org/3/library/tkinter.html.

from tkinter import TRUE

cleanup_data = TRUE

It should have simply been

cleanup_data = True

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 prayagupa