Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AttributeError: module 'setuptools._distutils' has no attribute 'version'

I was trying to train a model using tensorboard. While executing, I got this error:

$ python train.py Traceback (most recent call last): File "train.py", line 6, in <module> from torch.utils.tensorboard import SummaryWriter File "C:\Users\91960\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\utils\tensorboard\__init__.py", line 4, in <module> LooseVersion = distutils.version.LooseVersion

AttributeError: module 'setuptools._distutils' has no attribute 'version'.

I'm using python 3.8.9 64-bit & tensorflow with distutils is already installed which is required by tensorboard.

Why is this happening ? Please help !

like image 778
Anay Dongre Avatar asked Mar 02 '23 08:03

Anay Dongre


1 Answers

This is a known bug which has been patched: https://github.com/pytorch/pytorch/pull/69904

You can either use the nightly-release of PyTorch, or otherwise downgrade setup tools to setuptools version 59.5.0:

pip install setuptools==59.5.0

like image 126
match Avatar answered Apr 06 '23 10:04

match