Connection between google colab and Anvil is not working

Hi,
I would like to show some interactive plots that I have saved as HTML file (generated with packages such as Bokeh) in my anvil app.
I generated the notebook in google colab. However, as I tried to import anvil.server, I get the following error:
AttributeError: module ‘anvil’ has no attribute ‘LiveObject’

Any suggestion on what is going wrong here?

thanks a lot
Shahrzad

Hello and welcome,

Could you please show a bit more of your code?

Best if the code is not a screenshot but a code block wrapped in backticks (more general tips here related to posting questions).

Hi and thanks a lot for your response. Actually I solved the problem by once uninstalling and installing back anvil and anvil-uplink in the colab notebook.

However now I have another question:
I am using “anvil” for generating an interactive app for an academic project. As I have no server to host the data, I found ““google colab”” the only way to connect anvil to my the Bokeh plots (html files), when I share the app with my colleagues. Yet, I see that the connection is not permanent as the google colab gets disconnected, when not used and maximum after 12 hours.

So my question is: What other way do you suggest to load and show html files in anvil app?

[In addition, I tried to avoid colab, so tried to upload the “HTML” files to google drive and used the following lines to load it into anvil, yet nothing was shown in the UI.
The lines:
f = app_files.topic_1_graph_html
media_obj=anvil.BlobMedia(‘text/html’, f.get_bytes())
self.i_frame_1.url = media_obj.get_url(True)

i_frame_1 is from: Data visualizations from my jupyter notebook to display in my anvil app]

bests
Shahrzad