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

fix: Remove unused distutils import #176

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gavindsouza
Copy link

distutils is deprecated in Python3.12 (ref: https://docs.python.org/3.10/library/distutils.html).

Since it's not explicitly being used - not sure if it was crucial to the working of any util, perhaps we could use packaging.version.Version if it's still needed.

Python 3.12.4 (main, Jun  6 2024, 18:26:44) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sweetviz
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/gavin/Desktop/v1/maggie#2546/.venv/lib/python3.12/site-packages/sweetviz/__init__.py", line 15, in <module>
    from sweetviz.sv_public import analyze, compare, compare_intra
  File "/home/gavin/Desktop/v1/maggie#2546/.venv/lib/python3.12/site-packages/sweetviz/sv_public.py", line 4, in <module>
    import sweetviz.dataframe_report
  File "/home/gavin/Desktop/v1/maggie#2546/.venv/lib/python3.12/site-packages/sweetviz/dataframe_report.py", line 10, in <module>
    import sweetviz.series_analyzer as sa
  File "/home/gavin/Desktop/v1/maggie#2546/.venv/lib/python3.12/site-packages/sweetviz/series_analyzer.py", line 8, in <module>
    from distutils.version import LooseVersion
ModuleNotFoundError: No module named 'distutils'

Distro: NixOS 24.05.3214.575f3027caa1 (Uakari) x86_64

distutils is deprecated in Python3.12 (ref: https://docs.python.org/3.10/library/distutils.html). 

Since it's not explicitly being used - not sure if it was crucial to the working of any util, perhaps we could use `packaging.version.Version` if it's still needed.


```
Python 3.12.4 (main, Jun  6 2024, 18:26:44) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sweetviz
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/gavin/Desktop/v1/maggie#2546/.venv/lib/python3.12/site-packages/sweetviz/__init__.py", line 15, in <module>
    from sweetviz.sv_public import analyze, compare, compare_intra
  File "/home/gavin/Desktop/v1/maggie#2546/.venv/lib/python3.12/site-packages/sweetviz/sv_public.py", line 4, in <module>
    import sweetviz.dataframe_report
  File "/home/gavin/Desktop/v1/maggie#2546/.venv/lib/python3.12/site-packages/sweetviz/dataframe_report.py", line 10, in <module>
    import sweetviz.series_analyzer as sa
  File "/home/gavin/Desktop/v1/maggie#2546/.venv/lib/python3.12/site-packages/sweetviz/series_analyzer.py", line 8, in <module>
    from distutils.version import LooseVersion
ModuleNotFoundError: No module named 'distutils'
```

Distro: NixOS 24.05.3214.575f3027caa1 (Uakari) x86_64
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

Successfully merging this pull request may close these issues.

1 participant