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

can't run codebraid with new version of jupyter-client #46

Closed
jaycunningham-8451 opened this issue Apr 22, 2021 · 4 comments
Closed

can't run codebraid with new version of jupyter-client #46

jaycunningham-8451 opened this issue Apr 22, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@jaycunningham-8451
Copy link

jaycunningham-8451 commented Apr 22, 2021

I have the following markdown:

% example
% Jay Cunningham
% 22 April 2021

# What's happening?

```{.python .cb.nb jupyter_kernel=python3 example=false session=foo}
print("hello, world")

I'm running the following command to create slides:

codebraid pandoc -f markdown example.md -t revealjs -s -i -o example.html

If I install jupyter-client==6.1.12, it works fine. If I upgrade it to the most-current jupyter-client==6.2.0, I (usually?) get the following error:

Traceback (most recent call last):
  File "/Users/j260381/.pyenv/versions/kayday-deep-dive/bin/codebraid", line 8, in <module>
    sys.exit(main())
  File "/Users/j260381/.pyenv/versions/3.8.7/envs/kayday-deep-dive/lib/python3.8/site-packages/codebraid/cmdline.py", line 107, in main
    args.func(args)
  File "/Users/j260381/.pyenv/versions/3.8.7/envs/kayday-deep-dive/lib/python3.8/site-packages/codebraid/cmdline.py", line 153, in pandoc
    converter.code_braid()
  File "/Users/j260381/.pyenv/versions/3.8.7/envs/kayday-deep-dive/lib/python3.8/site-packages/codebraid/converters/base.py", line 1199, in code_braid
    self._process_code_chunks()
  File "/Users/j260381/.pyenv/versions/3.8.7/envs/kayday-deep-dive/lib/python3.8/site-packages/codebraid/converters/base.py", line 1213, in _process_code_chunks
    cp.process()
  File "/Users/j260381/.pyenv/versions/3.8.7/envs/kayday-deep-dive/lib/python3.8/site-packages/codebraid/codeprocessors/base.py", line 603, in process
    self._run_jupyter(session)
  File "/Users/j260381/.pyenv/versions/3.8.7/envs/kayday-deep-dive/lib/python3.8/site-packages/codebraid/codeprocessors/base.py", line 1384, in _run_jupyter
    if msg['parent_header'].get('msg_id') != cc_jupyter_id:
TypeError: 'coroutine' object is not subscriptable
sys:1: RuntimeWarning: coroutine 'ZMQSocketChannel.get_msg' was never awaited

It sometimes works the first time I run codebraid after installing 6.2.0, but it always fails the second or further times I run it after making a change to the markdown.

@gpoore
Copy link
Owner

gpoore commented Apr 22, 2021

It looks like all releases since 6.1.12 have had issues and will be replaced with an upcoming 7.0.0: https://github.com/jupyter/jupyter_client/blob/master/docs/changelog.rst. The Codebraid error is likely related to https://github.com/jupyter/jupyter_client/blob/master/docs/changelog.rst. I'm guessing that Codebraid needs an await somewhere, but will have to see if that's still the case with 7.0.0.

If you have a chance, please test against jupyter-client 7.0.0a. Otherwise, I'm currently working on some other Codebraid issues, and can probably take a look in a few days when that's finished.

@jaycunningham-8451
Copy link
Author

Apologies for the very long delay here. For what it's worth, I'm seeing the a different (but extremely similar) error with jupyter-client 7.0.4. (Python 3.9.7, macOS 11.6, codebraid 0.5.0)

Pinning to jupyter-client 6.1.12 still does work, though.

@gpoore
Copy link
Owner

gpoore commented Oct 14, 2021

Thanks for the update. I've been working on the next version of Codebraid for several months. To support several new features, I'm reimplementing much of the core as async, including interaction with jupyter-client. These issues should all be resolved whenever I can finish the next release.

gpoore added a commit that referenced this issue Feb 21, 2022
…gress display and improved live output (#21); improved error and warning handling; added non-zero exit code for document errors (#24); reimplemented all code execution as async (#46); additional improvements listed in changelog
@gpoore
Copy link
Owner

gpoore commented Feb 23, 2022

This should be fixed in the latest release. All interaction with jupyter_client is now async.

@gpoore gpoore added the bug Something isn't working label Oct 17, 2023
@gpoore gpoore closed this as completed Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants