Skip to content

Circular Import in Client Version 36.0.0a2 #2564

@8R0WNI3

Description

@8R0WNI3

What happened (please include outputs or screenshots):

> python3 -c "import kubernetes"

Traceback (most recent call last):
  File "<string>", line 1, in <module>
    import kubernetes
  File "/opt/homebrew/lib/python3.14/site-packages/kubernetes/__init__.py", line 26, in <module>
    from . import informer
ImportError: cannot import name 'informer' from partially initialized module 'kubernetes' (most likely due to a circular import) (/opt/homebrew/lib/python3.14/site-packages/kubernetes/__init__.py)

What you expected to happen:
Import of kubernetes package to work successfully.

How to reproduce it (as minimally and precisely as possible):

> pip3 install --upgrade --pre kubernetes

[REDACTED]
Successfully installed kubernetes-36.0.0a2
> python3 -c "import kubernetes"

Traceback (most recent call last):
  File "<string>", line 1, in <module>
    import kubernetes
  File "/opt/homebrew/lib/python3.14/site-packages/kubernetes/__init__.py", line 26, in <module>
    from . import informer
ImportError: cannot import name 'informer' from partially initialized module 'kubernetes' (most likely due to a circular import) (/opt/homebrew/lib/python3.14/site-packages/kubernetes/__init__.py)

Anything else we need to know?:

Environment:

  • Kubernetes version (kubectl version):
Client Version: v1.35.3
Kustomize Version: v5.7.1
Server Version: v1.35.4
  • OS (e.g., MacOS 10.13.6): Darwin Kernel Version 25.4.0
  • Python version (python --version): 3.14.4
  • Python client version (pip list | grep kubernetes): 36.0.0a2

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions