1

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.
Edd
  • 86
  • 5
AaronDT
  • 3,940
  • 8
  • 31
  • 71
  • 1
    Possible duplicate of [Generating a PNG with matplotlib when DISPLAY is undefined](https://stackoverflow.com/questions/2801882/generating-a-png-with-matplotlib-when-display-is-undefined) – A.Queue May 29 '18 at 14:59
  • Same question was asked [here](https://stackoverflow.com/questions/50118660/not-able-to-import-matplotlib-in-google-flexible-app-engine-with-flask-and-pytho). – A.Queue May 29 '18 at 14:59
  • Wrong duplicate, the error stack traces are completely different. – hoefling May 29 '18 at 15:43
  • 1
    @aarondt you are probably missing the [BLT library](http://blt.sourceforge.net); running `ldconfig -p | grep libBLT` will show you whether `libBLT` is available on your system. If not, you have to google what package offers the library on your OS (`python-tk`/`python3-tk` on Ubuntu etc). If the library is found, add the output of the `ldconfig` command to the question. – hoefling May 29 '18 at 15:51
  • You may also find this question useful: [matplotlib won't draw python3](https://stackoverflow.com/questions/12948446/matplotlib-wont-draw-python3) – hoefling May 29 '18 at 15:53
  • I have same problem now. [502 Bad Gateway in GAE with Django, & Log say "libBLT.2.5.so.8.6 No such file or directory"](https://stackoverflow.com/questions/73729042/502-bad-gateway-in-gae-with-django-log-say-libblt-2-5-so-8-6-no-such-file-or) Did you solve it? Thank you. – Shintaro Takahashi Sep 16 '22 at 01:43

1 Answers1

0

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
prayagupa
  • 30,204
  • 14
  • 155
  • 192