Skip to content

Deprecated distutils - incompatibility with Python 3.12 #1330

@tohuuuuu

Description

@tohuuuuu

Describe the bug
Trying to follow the Quick Start example with Python 3.12, i ran into a ModuleNotFound error: No module named 'distutils'.

To Reproduce

Just run the first example from the "Walktrough" section of the Quick Start guide. See Traceback below.

Traceback

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 2
      1 import pandas as pd
----> 2 from yellowbrick.datasets import load_bikeshare
      4 X, y = load_bikeshare()
      5 print(X.head())

File ~/develop/git/yb-playground/.venv/lib/python3.12/site-packages/yellowbrick/__init__.py:31
     28 from .version import get_version, __version_info__
     30 # Import the style management functions
---> 31 from .style.rcmod import reset_defaults, reset_orig
     32 from .style.rcmod import set_aesthetic, set_style, set_palette
     33 from .style.palettes import color_palette, set_color_codes

File ~/develop/git/yb-playground/.venv/lib/python3.12/site-packages/yellowbrick/style/__init__.py:20
     12 """
     13 Manage the style and aesthetic of the yellowbrick library.
     14 """
     16 ##########################################################################
     17 ## Imports
     18 ##########################################################################
---> 20 from .colors import *
     21 from .palettes import *
     22 from .rcmod import *

File ~/develop/git/yb-playground/.venv/lib/python3.12/site-packages/yellowbrick/style/colors.py:33
     29 from yellowbrick.exceptions import YellowbrickValueError
     32 # Check to see if matplotlib is at least sorta up to date
---> 33 ``from distutils.version import LooseVersion``
     35 mpl_ge_150 = LooseVersion(mpl.__version__) >= "1.5.0"
     38 ##########################################################################
     39 ## Color Utilities
     40 ##########################################################################

ModuleNotFoundError: No module named 'distutils'

Desktop (please complete the following information):

  • OS: Linux
  • Python Version 3.12
  • Yellowbrick Version 1.5

Should be solved with #1323 , I assume.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions