简体   繁体   English

AttributeError: 模块 'setuptools._distutils' 没有属性 'version'

[英]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.

相关问题 ModuleNotFoundError:没有名为“setuptools._distutils”的模块 - ModuleNotFoundError: No module named 'setuptools._distutils' AttributeError:模块“_distutils_hack”没有属性“ensure_shim” - AttributeError: module '_distutils_hack' has no attribute 'ensure_shim' AttributeError:模块&#39;numpy&#39;没有属性&#39;version&#39; - AttributeError: module 'numpy' has no attribute 'version' AttributeError: 'module' object 没有属性 '__version__' - AttributeError: 'module' object has no attribute '__version__' AttributeError:“模块”对象没有属性“版本” - AttributeError: 'module' object has no attribute 'version' Canopy AttributeError: 模块 &#39;pandas&#39; 没有属性 &#39;__version__&#39; - AttributeError: module 'pandas' has no attribute '__version__' AttributeError:模块“jaxlib”没有属性“版本” - AttributeError: module 'jaxlib' has no attribute 'version' AttributeError: 模块 &#39;numexpr&#39; 没有属性 &#39;__version__&#39; - AttributeError: module 'numexpr' has no attribute '__version__' AttributeError:模块“火炬”没有属性“__version__” - AttributeError: module 'torch' has no attribute '__version__' AttributeError:模块'tensorflow'没有版本-1的属性'placeholder' - AttributeError: module 'tensorflow' has no attribute 'placeholder' with version -1
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM