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
How do I get Vizro to run in a Google Colab Notebook? #175
Comments
Hello @gbabeleda and thank you for raising the issue. What exactly happens when you run that code? Do you get any error messages or anything else? Please could you try running this code at the beginning of the notebook also and see what happens?
|
Hello @antonymilne! Thank you for responding. I ran this in a code cell
Followed by this
It results in this error: LookupError Traceback (most recent call last) File /usr/local/lib/python3.10/dist-packages/vizro/_vizro.py:62, in Vizro.build(self, dashboard) File /usr/local/lib/python3.10/dist-packages/vizro/_vizro.py:91, in Vizro._pre_build() File /usr/local/lib/python3.10/dist-packages/vizro/models/_models_utils.py:16, in _log_call.._wrapper(self, *args, **kwargs) File /usr/local/lib/python3.10/dist-packages/vizro/models/_dashboard.py:77, in Dashboard.pre_build(self) File /usr/local/lib/python3.10/dist-packages/dash/_pages.py:307, in register_page(module, path, path_template, name, order, title, description, image, image_url, redirect_from, layout, **kwargs) LookupError: <ContextVar name='callback_context' at 0x797eb5a812b0> |
Interesting, thank you for sharing! Two more things to try out just to debug a bit further:
|
With many thanks to a user inside QB who helped us troubleshoot this, I think we have made some progress on this. There seem to be two possible solutions:
Under the hood, the problem is not Vizro explicitly but rather the use of contextvars in
If you execute this with the Possibly this is another reason that Dash Pages officially doesn't work in Jupyter, but I have yet to fully get to the bottom of that. So far it seems easy to fix anyway. See also #109. |
Question
Im using a Google Colab Notebook due to my need to access a BigQuery instance in which I dont have access to other than via login with a google account.
Im not so sure how to make it work. Using the following snippet doesnt work as expected
Vizro().build(dashboard=dashboard).run()
Code/Examples
No response
Other information
No response
vizro version
No response
Python version
No response
OS
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: