Closed marketneutral closed 3 years ago
Loading pickles referencing dynamically defined objects is always going to be a mess. I'd strongly urge moving your MyObj
into an importable module, at that point this should work just fine.
This example is just a minimal reproducible error. In the actual problem I have a large existing codebase and am trying to build a panel app around it. In that codebase there are large objects which have been pickled which I need to load.
Sure, but I'd like to see an example that pickles an object type which is not defined dynamically in the app itself. Right now that is definitely not supported because of the way the Bokeh server dynamically creates a module for the script or notebook being served.
Ok - this repro example works when I move MyObj out into a .py file and then import it into each of the notebooks. Thanks.
ALL software version info
(this library, plus any other relevant software, e.g. bokeh, python, notebook, OS, browser, etc)
Jupyter and
panel serve
running on Ubuntu. Chrome browser running on Windows 10.I've confirmed that a simple panel app works with
panel serve
. I cannot get the pickled object to load; it works in the Jupyter session, not inpanel serve
.Description of expected behavior and the observed behavior
I can load a pickled object in a notebook session, but not in a
panel serve
session.I run
Untitled.ipynb
in a Jupyter sessionI then run
Untiltled1.ipynb
in a Jupyter sessionThat works fine.
I then run
panel serve --allow-websocket-origin=<mydomain>:5006 --autoreload Untitled1.ipynb
This throws the error in the browser below.
Complete, minimal, self-contained example code that reproduces the issue
Notebook: Untiltled.ipynb
Notebook: Untiltled1.ipynb
Stack traceback and/or browser JavaScript console output
Stack trace in the browser
Screenshots or screencasts of the bug in action
Works fine in Jupyter:![image](https://user-images.githubusercontent.com/16124573/121227295-65c53680-c859-11eb-8383-1c8e70aa698d.png)
Fails on![image](https://user-images.githubusercontent.com/16124573/121227770-f3088b00-c859-11eb-8189-4db9c5960425.png)
panel serve
in browser