imbue-ai / jupyter_ascending.vim

Vim plugin to interact with jupyter_ascending
MIT License
166 stars 16 forks source link

Send to jupyter failed #20

Open chenboshuo opened 1 year ago

chenboshuo commented 1 year ago

The log of jupyter is

Either a properly named notebook (ending in .sync.ipynb) is not running, or it didn't register properly for some reason.
{"jsonrpc": "2.0", "result": {"success": false, "error": "Unable to find a paired notebook for /tmp/temp_downloads/try.sync.py in registered notebooks: {}.\nEither a properly named notebook (ending in .sync.ipynb) is not running, or it didn't register properly for some reason."}, "id": 1}

And I check the .sync.ipynbexist Could you tell me how to handle it, Thank you for your attention.

chenboshuo commented 1 year ago

And the content from /tmp/jupyter_ascending/log.log is

> File "/home/cbs/anaconda3/lib/python3.9/site-packages/jupyter_ascending/requests/sync.py", line 36, in <module>
    send(arguments.filename)
    │    │         └ '/tmp/temp_downloads/try.sync.py'
    │    └ Namespace(filename='/tmp/temp_downloads/try.sync.py')
    └ <function send at 0x7fb85e31b430>
  File "/home/cbs/anaconda3/lib/python3.9/site-packages/jupyter_ascending/requests/sync.py", line 24, in send
    request_notebook_command(request_obj)
    │                        └ SyncRequest(file_name='/tmp/temp_downloads/try.sync.py', contents='# ---\n# jupyter:\n#   jupytext:\n#     formats: ipynb,py:...
    └ <function request_notebook_command at 0x7fb85e31b3a0>
  File "/home/cbs/anaconda3/lib/python3.9/site-packages/jupyter_ascending/requests/client_lib.py", line 36, in request_notebook_command
    raise RequestFailure(
          └ <class 'jupyter_ascending.requests.client_lib.RequestFailure'>

jupyter_ascending.requests.client_lib.RequestFailure: Connection to server successful, but got error message from server: Unable to find a paired notebook for /tmp/temp_downloads/try.sync.py in registered notebooks: {}.
Either a properly named notebook (ending in .sync.ipynb) is not running, or it didn't register properly for some reason.
joshalbrecht commented 1 year ago

Are there any other errors or warnings earlier in the server log?

You should see the output as a result of this line above in the log, assuming logging is configured:

logger.info("IPYTHON: Registering notebook {}", notebook_path)

Could you copy that line here? (the name of the notebook on the remote and local machine need to line up)

LioSergent commented 9 months ago

Got a similar error and corrected the problem by changing the way jupytext organizes files. I had a jupytext config containing:

[formats]
"notebooks/" = "ipynb"
"scripts/" = "py:percent"

which meant the name.sync.ipynb and name.sync.py were not in the same folder.

I switched it back to the more classic

formats = "ipynb,py:percent"

and it now works