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

Support Python>=3.12 #109

Open
MarcSkovMadsen opened this issue Sep 21, 2024 · 1 comment
Open

Support Python>=3.12 #109

MarcSkovMadsen opened this issue Sep 21, 2024 · 1 comment

Comments

@MarcSkovMadsen
Copy link

I just tried installing ipywidgets_bokeh on python 3.12. When running an app I see

2024-09-21 12:50:58,551 Error running application handler <panel.io.handlers.ScriptHandler object at 0x7f2de053ee40>: No module named 'distutils'
File 'kernel.py', line 12, in <module>:
from distutils.version import LooseVersion Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/panel/io/handlers.py", line 405, in run
    exec(self._code, module.__dict__)
  File "/code/app.py", line 4, in <module>
    pn.extension("ipywidgets")
  File "/usr/local/lib/python3.12/site-packages/pyviz_comms/__init__.py", line 64, in __new__
    return param.ParameterizedFunction.__new__(cls, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/param/parameterized.py", line 4468, in __new__
    return inst.__call__(*args,**params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/panel/config.py", line 742, in __call__
    __import__(module)
  File "/usr/local/lib/python3.12/site-packages/panel/io/ipywidget.py", line 22, in <module>
    from ipywidgets_bokeh.kernel import (
  File "/usr/local/lib/python3.12/site-packages/ipywidgets_bokeh/__init__.py", line 1, in <module>
    from .widget import IPyWidget
  File "/usr/local/lib/python3.12/site-packages/ipywidgets_bokeh/widget.py", line 13, in <module>
    from .kernel import kernel
  File "/usr/local/lib/python3.12/site-packages/ipywidgets_bokeh/kernel.py", line 12, in <module>
    from distutils.version import LooseVersion
ModuleNotFoundError: No module named 'distutils'

According to pop-0632 distutils has been deprecated with python 3.10 and removed with Python 3.12.

@hoxbro
Copy link

hoxbro commented Sep 21, 2024

Could you try install setuptools in your environment?

I think LooseVersion should be changed to packaging.version.Version for version checking.

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