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

Problem Connecting to coconut kernel from notebook #682

Closed
rtbs-dev opened this issue Nov 8, 2022 · 1 comment
Closed

Problem Connecting to coconut kernel from notebook #682

rtbs-dev opened this issue Nov 8, 2022 · 1 comment

Comments

@rtbs-dev
Copy link

rtbs-dev commented Nov 8, 2022

[I 09:35:01.926 NotebookApp] KernelRestarter: restarting kernel (1/5), new random ports
CONDA_PREFIX=/home/tbsexton/miniconda3/envs/coco
Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 148, in _get_module_details
  File "<frozen runpy>", line 112, in _get_module_details
  File "/home/tbsexton/miniconda3/envs/coco/lib/python3.11/site-packages/coconut/icoconut/__init__.py", line 20, in <module>
    from coconut.icoconut.root import *  # NOQA
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tbsexton/miniconda3/envs/coco/lib/python3.11/site-packages/coconut/icoconut/root.py", line 51, in <module>
    from coconut.compiler import Compiler
  File "/home/tbsexton/miniconda3/envs/coco/lib/python3.11/site-packages/coconut/compiler/__init__.py", line 20, in <module>
    from coconut.compiler.compiler import *  # NOQA
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tbsexton/miniconda3/envs/coco/lib/python3.11/site-packages/coconut/compiler/compiler.py", line 108, in <module>
    from coconut.compiler.matching import Matcher
  File "/home/tbsexton/miniconda3/envs/coco/lib/python3.11/site-packages/coconut/compiler/matching.py", line 44, in <module>
    from coconut.compiler.util import (
  File "/home/tbsexton/miniconda3/envs/coco/lib/python3.11/site-packages/coconut/compiler/util.py", line 732, in <module>
    stores_loc_item = attach(Empty(), stores_loc_action)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tbsexton/miniconda3/envs/coco/lib/python3.11/site-packages/coconut/compiler/util.py", line 305, in attach
    return add_action(item, action)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tbsexton/miniconda3/envs/coco/lib/python3.11/site-packages/coconut/compiler/util.py", line 277, in add_action
    internal_assert(item_ref_count >= temp_grammar_item_ref_count, "add_action got item with too low ref count", (item, type(item), item_ref_count))
  File "/home/tbsexton/miniconda3/envs/coco/lib/python3.11/site-packages/coconut/terminal.py", line 118, in internal_assert
    raise error
coconut.exceptions.CoconutInternalException: add_action got item with too low ref count: (<type object at 0x55c442f9c9c0>, <class 'cPyparsing.Empty'>, 3) (you should report this at https://github.com/evhub/coconut/issues/new)

This comes from a new install in a fresh conda environment:

~$ conda create -n "coco" pip
~$ conda activate coco
~$ pip install coconut[kernel] beartype

The kernel ends up spitting out this error and restarting 5 times. I get the little "broken chain" link symbol in my notebook.

@evhub evhub added this to the v2.1.1 milestone Nov 8, 2022
@evhub
Copy link
Owner

evhub commented Nov 8, 2022

I assume you're running on Python 3.11? I'm pretty sure this is a Python-3.11-specific issue. It should be fixed on coconut-develop, or you can just downgrade to Python 3.10. I could also try to just get another release out if Python 3.11 support on the released version is really important.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants