Kanaries / pygwalker

PyGWalker: Turn your pandas dataframe into an interactive UI for visual analysis
https://kanaries.net/pygwalker
Apache License 2.0
10.83k stars 549 forks source link

[BUG] pygwalker not working in clean Python 3.12 virtual environment #493

Closed KerstinKeller closed 3 months ago

KerstinKeller commented 4 months ago

Describe the bug I have a clean Python 3.12 virtual environment. Installing pygwalker with

pip install pygwalker

and then importing it

import pygwalker as pyg

Traceback

Traceback (most recent call last):
  File "D:\pygwalker\inspect_data.py", line 1, in <module>
    import pygwalker as pyg
  File "D:\pygwalker\.venv\Lib\site-packages\pygwalker\__init__.py", line 16, in <module>
    from pygwalker.api.jupyter import walk, render, table
  File "D:\pygwalker\.venv\Lib\site-packages\pygwalker\api\jupyter.py", line 6, in <module>
    from .pygwalker import PygWalker
  File "D:\pygwalker\.venv\Lib\site-packages\pygwalker\api\pygwalker.py", line 34, in <module>
    from pygwalker.services.spec import get_spec_json, fill_new_fields
  File "D:\pygwalker\.venv\Lib\site-packages\pygwalker\services\spec.py", line 3, in <module>
    from distutils.version import StrictVersion
ModuleNotFoundError: No module named 'distutils'

Expected behavior pygwalker is working with Python 3.12

Versions

Additional context Distutils module was removed in Python 3.12. (and deprecated in 3.10).

ObservedObserver commented 4 months ago

Hi @KerstinKeller, thanks for the feedback and context. I think this issues can be fixed by replacing distutils.StrictVersion with packaging.version, it will be fixed in next release.

longxiaofei commented 4 months ago

Hi @KerstinKeller , I published a pre-release version to fix it.

You can use this version first.

pip install pygwalker==0.4.8a5