Bokeh v2.0.0 fails with PyInstaller

26 views
Skip to first unread message

Dan Cutright

unread,
Mar 11, 2020, 4:17:35 AM3/11/20
to PyInstaller
I've had success with PyInstaller and Bokeh v1.4.0, but the subsequent version (v2.0.0) produces the following error:

FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/w9/59qs933d4dq1j2214v_dz1sr0000gn/T/_MEI8f9v8X/bokeh/_sri.json'

"_sri.json is a new file that must be present in the package."

Can this be included by editing my .spec file?  Or perhaps the bokeh hook?

My current hook file:
from PyInstaller.utils.hooks import collect_data_files


# core/_templates/*
# server/static/**/*
# subcommands/*.py


datas
= collect_data_files('bokeh.core') + \
        collect_data_files
('bokeh.server') + \
        collect_data_files
('bokeh.command.subcommands', include_py_files=True)



Eric Fahlgren

unread,
Mar 11, 2020, 10:00:40 AM3/11/20
to pyins...@googlegroups.com
From dumping out some 'datas' values, it looks like it's simply a list of tuples: [(src, dst), (src, dst), ...]  So, you should be able to add something like this to the hook:

import os
from PyInstaller.utils.hooks import get_module_file_attribute

src = os.path.join(os.path.dirname(get_module_file_attribute('bokeh')), '_sri.json')
dst = 'deduce from dumping original collect_data_files output'
datas = [(src, dst)] + \
             collect... all the original stuff


--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyinstaller...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/f973760d-00d7-4bb6-a68f-146b350c7a20%40googlegroups.com.

Hartmut Goebel

unread,
Mar 11, 2020, 10:04:45 AM3/11/20
to pyins...@googlegroups.com
Am 11.03.20 um 14:40 schrieb Eric Fahlgren:
From dumping out some 'datas' values, it looks like it's simply a list of tuples: [(src, dst), (src, dst), ...]  So, you should be able to add something like this to the hook:

This is implemented in the manual.

--
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer
Information Security Management, Security Governance, Secure Software Development

Goebel Consult, Landshut
http://www.goebel-consult.de

Blog: https://www.goe-con.de/blog/nicht-pgp-ist-gescheitert-die-entwickler-haben-versagt
Kolumne: https://www.goe-con.de/hartmut-goebel/cissp-gefluester/2010-06-adobe-und-der-maiszunsler

0x7B752811BF773B65.asc

Hartmut Goebel

unread,
Mar 11, 2020, 10:08:45 AM3/11/20
to pyins...@googlegroups.com
Am 11.03.20 um 04:09 schrieb Dan Cutright:
"_sri.json is a new file that must be present in the package."

So please update the hook and provide a pull-request. Thanks.

--
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer
Information Security Management, Security Governance, Secure Software Development

Goebel Consult, Landshut
http://www.goebel-consult.de

0x7B752811BF773B65.asc

Dan Cutright

unread,
Mar 11, 2020, 12:11:02 PM3/11/20
to PyInstaller
Sorry, to duplicate stuff... in the time it took this post to show up (since it was my first one), I got it working and posted my solution on PyInstaller GitHub.  But I'm a new PyInstaller user and wonder if it there' a better way before doing a pull request.  Maybe best to just use the GitHub issue here on?  Or maybe that sort of thing gets sorted out during the pull request?


Basically I just added collect_data_files('bokeh')  to datas in the bokeh hook.  Not sure if that's the most appropriate method or not.
Reply all
Reply to author
Forward
0 new messages