Mercury + Mito + jupyter notebook

23 views Asked by At

I built a web application via Mercury, which run some script and show tables. But now I need to implement opportunity to edit those tables inside the web app.

I tried a Mito package

import mitosheet
import pandas as pd

df = pd.read_csv('C://Users//USER//Downloads//archive//Iris.csv')
mitosheet.sheet(df, analysis_to_replay="id-sfsxwatuac")

But got an error 'CaptureShell' object has no attribute 'kernel'

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[1], line 6
      4 df = pd.read_csv('C://Users//USER//Downloads//archive//Iris.csv')
      5 import mitosheet
----> 6 mitosheet.sheet(df, analysis_to_replay="id-sfsxwatuac")

File ~\anaconda3\Lib\site-packages\mitosheet\mito_backend.py:448, in sheet(analysis_to_replay, view_df, sheet_functions, importers, editors, *args)
    439     mito_backend = get_mito_backend(
    440         *args, 
    441         analysis_to_replay=analysis_to_replay, 
   (...)
    444         user_defined_editors=editors,
    445     )
    447     # Setup the comm target on this
--> 448     mito_backend = register_comm_target_on_mito_backend(
    449         mito_backend,
    450         comm_target_id
    451     )
    453 except:
    454     log('mitosheet_sheet_call_failed', failed=True)

File ~\anaconda3\Lib\site-packages\mitosheet\mito_backend.py:360, in register_comm_target_on_mito_backend(mito_backend, comm_target_id)
    357     comm.send({'echo': open_msg['content']['data']}) # type: ignore
    359 # Register the comm target - so the callback gets called
--> 360 ipython.kernel.comm_manager.register_target(comm_target_id, on_comm_creation)
    362 return mito_backend

AttributeError: 'CaptureShell' object has no attribute 'kernel'

Is it possible to fix this? And if not, which instruments I can use for running python script and table editing?

0

There are 0 answers