Skip to content

Depends on distutils, which has been removed from python3.12 #83

@vischia

Description

@vischia

Hello,

it seems that distutils has been removed from python, in favour of setuptools.

When running in python3.12, importing torchviz fails (see error message below [1]) because dot.py still explicitly imports distutils: it would be good to fix this dependency, otherwise people will have to drop torchviz from their workflows.

Thank you very much in advance!

Cheers,
Pietro

[1]

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[6], line 8
      6 import numpy as np
      7 import torch
----> 8 from torchviz import make_dot

File venv/lib/python3.12/site-packages/torchviz/__init__.py:1
----> 1 from .dot import make_dot, make_dot_from_trace

File venv/lib/python3.12/site-packages/torchviz/dot.py:2
      1 from collections import namedtuple
----> 2 from distutils.version import LooseVersion
      3 from graphviz import Digraph
      4 import torch

ModuleNotFoundError: No module named 'distutils'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions