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

Import error when using python 3.11 #7

Open
strayMat opened this issue Jul 24, 2024 · 1 comment
Open

Import error when using python 3.11 #7

strayMat opened this issue Jul 24, 2024 · 1 comment

Comments

@strayMat
Copy link

strayMat commented Jul 24, 2024

Hello !
I have an import error when using metanno with python 3.11. It seems to be linked to the collection package :

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[60], line 1
----> 1 import metanno

File ~/.user_conda/miniconda/envs/iqss/lib/python3.11/site-packages/metanno/__init__.py:1
----> 1 from .manager import AppManager
      2 from .base import App
      3 from .utils import kernel_only, frontend_only, chain_map, chain_list, produce, get_idx

File ~/.user_conda/miniconda/envs/iqss/lib/python3.11/site-packages/metanno/manager.py:8
      5 import sys
      6 from ipykernel.comm import Comm
----> 8 from .immutable import AutoProxy, apply_patches, commit
      9 from .python_to_javascript import transcrypt_class
     10 from .views import SpanEditor, TableEditor

File ~/.user_conda/miniconda/envs/iqss/lib/python3.11/site-packages/metanno/immutable.py:164
    159 @dataclass
    160 class SequenceProxyState(ProxyState[T]):
    161     keys: T
--> 164 class SequenceProxy(Proxy[T], collections.Sequence):
    165     _state = SequenceProxyState[T]
    167     def __init__(self, base: Any, copy: Any = None, parent: ProxyState = None, setter_args=None, setter_method=None, keys: T = None, on_change=None):

AttributeError: module 'collections' has no attribute 'Sequence'

It might be relevant either :

  • to modify the typing to be supported by python 3.11: For this, using collections.abc.Sequence instead of collections.Sequence might do the trick. I can try to provide a PR.

  • to change the pyproject.toml to explicitly not support python 3.11

@percevalw
Copy link
Owner

Hi @strayMat, indeed metanno is currently compatible only with python 3.9, for typing issues but also because of the python -> js transpilation step. The next version should relax these requirements, but I don't have a timeline for its release at the moment

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

No branches or pull requests

2 participants