[英]AttributeError: module 'setuptools._distutils' has no attribute 'version'
I was trying to train a model using tensorboard.我正在尝试使用张量板训练 model。 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'
. 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.我正在使用 python 3.8.9 64 位和 tensorflow 已经安装了张量板所需的 distutils。
Why is this happening?为什么会这样? Please help !
请帮忙 !
This is a known bug which has been patched: https://github.com/pytorch/pytorch/pull/69904这是一个已修复的已知错误: https://github.com/pytorch/pytorch/pull/69904
You can either use the nightly-release of PyTorch, or otherwise downgrade setup tools to setuptools==59.5.0
您可以使用 PyTorch 的夜间版本,或者将设置工具降级为
setuptools==59.5.0
This command did the trick for me:这个命令对我有用:
python3 -m pip install setuptools==59.5.0
pip successfully installed this version: pip 成功安装此版本:
Successfully installed setuptools-60.1.0
instead of setuptools-60.2.0
Successfully installed setuptools-60.1.0
而不是setuptools-60.2.0
I personally needed to run this:我个人需要运行这个:
pip install fairseq
pip install setuptools==59.5.0
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.