Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot panel convert without having dependencies installed #4090

Open
MarcSkovMadsen opened this issue Nov 7, 2022 · 2 comments
Open

Cannot panel convert without having dependencies installed #4090

MarcSkovMadsen opened this issue Nov 7, 2022 · 2 comments
Labels
type: bug Something isn't correct or isn't working webassembly

Comments

@MarcSkovMadsen
Copy link
Collaborator

panel==0.14.1

I would expect to be able to panel convert apps without having all the dependencies installed. I would only expect it to be nescessary for prerending. But it seems not to be the case.

import panel as pn
import textblob

pn.panel("hello").servable()
panel convert script.py --skip-embed
ERROR:bokeh.application.application:Error running application handler <bokeh.application.handlers.script.ScriptHandler object at 0x7f25bac38ca0>: No module named 'textblob'
File 'script.py', line 2, in <module>:
import textblob Traceback (most recent call last):
  File "/home/jovyan/repos/private/awesome-panel/panel-sharing/.venv/lib/python3.9/site-packages/bokeh/application/handlers/code_runner.py", line 231, in run
    exec(self._code, module.__dict__)
  File "/home/jovyan/repos/private/awesome-panel/panel-sharing/script.py", line 2, in <module>
    import textblob
ModuleNotFoundError: No module named 'textblob'
 
Failed to convert script.py to pyodide target: The file script.py does not publish any Panel contents. Ensure you have marked items as servable or added models to the bokeh document manually.

Additional Context

I am trying to get Panel Sharing to be more robust. @sophiamyang broke it as soon as she started trying it out in preparation for her New York talk. See awesome-panel/panel-sharing#22 and awesome-panel/panel-sharing#23

@MarcSkovMadsen MarcSkovMadsen added the type: bug Something isn't correct or isn't working label Nov 7, 2022
@MarcSkovMadsen MarcSkovMadsen added this to the Wishlist milestone Nov 7, 2022
@MarcSkovMadsen
Copy link
Collaborator Author

It is funny because if I move the textblob down it generates the script.html file.

import panel as pn

pn.panel("hello").servable()
import textblob
$ panel convert script.py --skip-embed
ERROR:bokeh.application.application:Error running application handler <bokeh.application.handlers.script.ScriptHandler object at 0x7f1c55106c70>: No module named 'textblob'
File 'script.py', line 4, in <module>:
import textblob Traceback (most recent call last):
  File "/home/jovyan/repos/private/awesome-panel/panel-sharing/.venv/lib/python3.9/site-packages/bokeh/application/handlers/code_runner.py", line 231, in run
    exec(self._code, module.__dict__)
  File "/home/jovyan/repos/private/awesome-panel/panel-sharing/script.py", line 4, in <module>
    import textblob
ModuleNotFoundError: No module named 'textblob'
 
Successfully converted script.py to pyodide target and wrote output to script.html.

@MarcSkovMadsen
Copy link
Collaborator Author

Without being able to panel convert apps without having the dependencies installed a lot of the point of Panel Sharing goes out the window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't correct or isn't working webassembly
Projects
None yet
Development

No branches or pull requests

2 participants