question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Package is missing extra data

See original GitHub issue

Eel version

$ pip freeze | grep -i eel
Eel==0.12.3

Describe the bug

When I run the built package, it starts properly. But within the application, it says

To Reproduce Steps to reproduce the behavior:

$ git clone https://github.com/MartinThoma/write-math-eel.git && cd write-math-eel
$ python -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
$ pip install pyinstaller
$ python -m eel main.py web --onefile --noconsole
$ cd dist
$ ./main 
# A window pops up - draw something in it, e.g. the greek letter "alpha"
# Then:
Traceback (most recent call last):
  File "src/gevent/greenlet.py", line 854, in gevent._gevent_cgreenlet.Greenlet.run
  File "venv/lib/python3.8/site-packages/eel/__init__.py", line 259, in _process_message
  File "main.py", line 43, in worker
  File "venv/lib/python3.8/site-packages/hwrt/classify.py", line 92, in classify_segmented_recording
  File "venv/lib/python3.8/site-packages/hwrt/classify.py", line 28, in __init__
  File "venv/lib/python3.8/site-packages/hwrt/utils.py", line 451, in load_model
  File "tarfile.py", line 1599, in open
  File "tarfile.py", line 1664, in gzopen
  File "gzip.py", line 173, in __init__
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/_MEIY94PgK/hwrt/misc/model.tar'
2020-06-21T19:56:17Z <Greenlet at 0x7f0bd34bb040: _process_message({'call': 1.9957332098804472, 'name': 'worker', 'ar, <geventwebsocket.websocket.WebSocket object at 0x7)> failed with FileNotFoundError

The hwrt/misc/model.tar comes from those two lines:

model_path = pkg_resources.resource_filename("hwrt", "misc/")
model_file = os.path.join(model_path, "model.tar")

Expected behavior

A list of recognized symbols should have appeared, similar as on write-math.com

Desktop (please complete the following information):

  • OS: Ubuntu 20.04
  • Browser: Chrome 83

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

6reactions
samuelhwilliamscommented, Jun 21, 2020

@MartinThoma - I had a bit of a dig and came up with this build script that will work out the file path for model.tar and include it in the package.

build.py (assuming Python 3.6+)

import pkg_resources as pkg
import PyInstaller.__main__ as pyi
import os
from argparse import ArgumentParser

eel_js_file = pkg.resource_filename("eel", "eel.js")
js_file_arg = f"{eel_js_file}{os.pathsep}eel"
web_folder_arg = f"web{os.pathsep}web"

model_tar_file = pkg.resource_filename("hwrt", os.path.join("misc", "model.tar"))
model_file_arg = f"{model_tar_file}{os.pathsep}{os.path.join('hwrt', 'misc')}"

pyinstaller_args = [
    "--hidden-import",
    "bottle_websocket",
    "--add-data",
    js_file_arg,
    "--add-data",
    web_folder_arg,
    "--add-data",
    model_file_arg,
    "main.py",
    "--onefile",
]

print("Running:\npyinstaller", " ".join(pyinstaller_args), "\n")

pyi.run(pyinstaller_args)

Feel free to copy that into build.py and run it with python build.py - let me know if it works & hope it helps!

0reactions
samuelhwilliamscommented, Jun 21, 2020

More than enough - thanks! 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extra - Missing Data Tools
Extra - Missing Data Tools · Necessary Packages · Missing data visualization · Missing data summaries · Shadow matrices · Missing data imputation...
Read more >
"Failure to download extra data files" after installing ttf ...
Solution 1: Connect to the internet and run this command below, to fix the error sudo apt-get install --reinstall ttf-mscorefonts-installer.
Read more >
"Missing extra locale data" error even after registerLocaleData ...
In my project, I have an error when using DatePipe that says "Error: Missing extra locale data for the locale "fr".
Read more >
How to FIX Missing DLC Data Pack in Modern Warfare 2 ...
Do you want to know how to FIX the Missing Single Player DLC Packs or ... ((( Subscribe to my ADVENTURE CHANNEL )))...
Read more >
EXtra-data — EXtra-data 1.12.0 documentation
EXtra -data is a Python library for accessing saved data produced at European XFEL. Installation . EXtra-data is available on our Anaconda...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found