Error with gsutil (google-cloud-cli)

I don’t know exactly in which version of google-cloud-cli I got this error, but I suddenly got this error when I tried to run gsutil:

$ gsutil
Traceback (most recent call last):
  File "/opt/google-cloud-cli/platform/gsutil/gsutil", line 21, in <module>
  File "/opt/google-cloud-cli/platform/gsutil/", line 150, in RunMain
    import gslib.__main__
  File "/opt/google-cloud-cli/platform/gsutil/gslib/", line 89, in <module>
    from gslib import wildcard_iterator
  File "/opt/google-cloud-cli/platform/gsutil/gslib/", line 43, in <module>
    from gslib.third_party.storage_apitools import storage_v1_messages as apitools_messages
  File "/opt/google-cloud-cli/platform/gsutil/gslib/third_party/storage_apitools/", line 22, in <module>
    from import encoding
  File "/opt/google-cloud-cli/platform/gsutil/third_party/apitools/apitools/base/py/", line 23, in <module>
    from import *
  File "/opt/google-cloud-cli/platform/gsutil/third_party/apitools/apitools/base/py/", line 45, in <module>
    import fasteners
  File "/opt/google-cloud-cli/platform/gsutil/third_party/fasteners/fasteners/", line 23, in <module>
    from fasteners.lock import locked  # noqa
  File "/opt/google-cloud-cli/platform/gsutil/third_party/fasteners/fasteners/", line 31, in <module>
    import eventlet
  File "/usr/lib/python3.10/site-packages/eventlet/", line 17, in <module>
    from eventlet import convenience
  File "/usr/lib/python3.10/site-packages/eventlet/", line 7, in <module>
    from import socket
  File "/usr/lib/python3.10/site-packages/eventlet/green/", line 21, in <module>
    from import greendns
  File "/usr/lib/python3.10/site-packages/eventlet/support/", line 66, in <module>
    setattr(dns, pkg, import_patched('dns.' + pkg))
  File "/usr/lib/python3.10/site-packages/eventlet/support/", line 61, in import_patched
    return patcher.import_patched(module_name, **modules)
  File "/usr/lib/python3.10/site-packages/eventlet/", line 132, in import_patched
    return inject(
  File "/usr/lib/python3.10/site-packages/eventlet/", line 109, in inject
    module = __import__(module_name, {}, {}, module_name.split('.')[:-1])
  File "/usr/lib/python3.10/site-packages/dns/", line 86, in <module>
    class Zone(dns.transaction.TransactionManager):
  File "/usr/lib/python3.10/site-packages/dns/", line 757, in Zone
    ) -> dns.rdtypes.ANY.SOA.SOA:
AttributeError: module 'dns.rdtypes' has no attribute 'ANY'

And this is my version of google-cloud-cli:

$ gcloud --version
Google Cloud SDK 424.0.0
alpha 2023.03.24
beta 2023.03.24
bq 2.0.89
bundled-python3-unix 3.9.16
core 2023.03.24
gcloud-crc32c 1.0.0
gsutil 5.21

Does anyone have any idea which library is conflicting with gsutil?

Thanks in advance.

Apparently it’s seems to be a problem with dnspython 2.3.0, I fix it downgrading dnspython to 2.2.1.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.