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

Python 3.11 not supported #54

Closed
veenstrajelmer opened this issue Jun 19, 2023 · 2 comments
Closed

Python 3.11 not supported #54

veenstrajelmer opened this issue Jun 19, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@veenstrajelmer
Copy link
Collaborator

veenstrajelmer commented Jun 19, 2023

Describe the bug
When creating a Python 3.11 environment, import meshkernel raises: "ValueError: mutable default <class 'numpy.ndarray'> for field face_nodes is not allowed: use default_factory"

Traceback (most recent call last):

  File ~\Anaconda3\envs\py311\Lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec
    exec(code, globals, locals)

  File c:\data\dfm_tools\dfm_tools\untitled0.py:8
    import meshkernel

  File ~\Anaconda3\envs\py311\Lib\site-packages\meshkernel\__init__.py:4
    from meshkernel.factories import Mesh2dFactory

  File ~\Anaconda3\envs\py311\Lib\site-packages\meshkernel\factories.py:4
    from meshkernel.py_structures import Mesh2d

  File ~\Anaconda3\envs\py311\Lib\site-packages\meshkernel\py_structures.py:80
    @dataclass

  File ~\Anaconda3\envs\py311\Lib\dataclasses.py:1223 in dataclass
    return wrap(cls)

  File ~\Anaconda3\envs\py311\Lib\dataclasses.py:1213 in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,

  File ~\Anaconda3\envs\py311\Lib\dataclasses.py:958 in _process_class
    cls_fields.append(_get_field(cls, name, type, kw_only))

  File ~\Anaconda3\envs\py311\Lib\dataclasses.py:815 in _get_field
    raise ValueError(f'mutable default {type(f.default)} for field '

ValueError: mutable default <class 'numpy.ndarray'> for field face_nodes is not allowed: use default_factory

To Reproduce
Steps to reproduce the behavior:

  1. create py311 environment
  2. import meshkernel

Version info (please complete the following information):

  • OS: Windows
  • Version latest pip (2.0.2)
@veenstrajelmer
Copy link
Collaborator Author

This is fixed already, but not in the latest release (2.0.2) yet.

@veenstrajelmer
Copy link
Collaborator Author

meshkernel 2.1.0 was released yesterday and is now available via pip. Therefore, an installation should now also work with python 3.11

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

1 participant