-
Notifications
You must be signed in to change notification settings - Fork 23.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: module 'distutils' has no attribute 'version' : with setuptools 59.6.0 #69894
Comments
…ools, so migrated to using packaging.version.Version.
As per PEP-632 migration advice, distutils.version should migrate to using packaging.version instead: |
These are outside the scope of the pull request, which only fixes the immediate problem of inability to import TensorBoard. |
Apparently there's an alternative pull request for this same bug here: #69823 |
#69904 should fix the immediate fallback of setuptools update. Also, |
setuptools 59.6.0 exposed a bug in pytorch, where pytorch is improperly importing a particular submodule of distutils. In old setuptools, distutils.version was automatically imported, but in new setuptools, it is not. For details, see: pytorch/pytorch#69894 Since forcing users to upgrade pytorch is not feasible, we intervene by enforcing that distutils.version is imported before we try to import the problematic torch.utils.tensorboard submodule. This workaround will not help users who import torch.utils.tensorboard directly, but it will protect users who only import torch.utils.tensorboard because of us.
setuptools 59.6.0 exposed a bug in pytorch, where pytorch is improperly importing a particular submodule of distutils. In old setuptools, distutils.version was automatically imported, but in new setuptools, it is not. For details, see: pytorch/pytorch#69894 Since forcing users to upgrade pytorch is not feasible, we intervene by enforcing that distutils.version is imported before we try to import the problematic torch.utils.tensorboard submodule. This workaround will not help users who import torch.utils.tensorboard directly, but it will protect users who only import torch.utils.tensorboard because of us.
Since #69904 has been merged, this issue can be closed. |
setuptools 59.6.0 exposed a bug in pytorch, where pytorch is improperly importing a particular submodule of distutils. In old setuptools, distutils.version was automatically imported, but in new setuptools, it is not. For details, see: pytorch/pytorch#69894 Since forcing users to upgrade pytorch is not feasible, we intervene by enforcing that distutils.version is imported before we try to import the problematic torch.utils.tensorboard submodule. This workaround will not help users who import torch.utils.tensorboard directly, but it will protect users who only import torch.utils.tensorboard because of us.
See <pytorch/pytorch#69894> for why, this should be reverted as soon as this PR lands in a pytorch release.
Still got error on torch1.110.2
|
I can confirm that this is still a problem, I am experiencing the same issue. |
Managed to resolve this by:
|
Worked for me! |
`AttributeError: module 'distutils' has no attribute 'version'` solved by this comment pytorch/pytorch#69894 (comment)
It works for me, thx! My env (miniconda): setuptools 59.5.0 added to my requirements.txt file: |
It works for me, thx! |
Thank you so much! |
So can't use the latest setuptools? |
works for me |
works for me, thanks! |
Wow Thanks !!! @Mayankm96 |
pip install setuptools==59.5.0 |
🐛 Describe the bug
Versions
cc @seemethere @malfet @pytorch/pytorch-dev-infra
The text was updated successfully, but these errors were encountered: