Skip to content
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

Circular references #19

Open
callum-p opened this issue Mar 9, 2022 · 1 comment
Open

Circular references #19

callum-p opened this issue Mar 9, 2022 · 1 comment

Comments

@callum-p
Copy link

callum-p commented Mar 9, 2022

Hi there,

I'm getting the below error when using this:

from kubernetes_typed.client import V1PodDict
ImportError: cannot import name 'AdmissionregistrationV1ServiceReferenceDict' from partially initialized module 'kubernetes_typed.client' (most likely due to a circular import) (/home/user/repos/xxx/k8s-monitor/.venv/lib/python3.8/site-packages/kubernetes_typed/client/__init__.py)
@suside
Copy link

suside commented Nov 3, 2022

Can confirm this is happening on a clean env.

$ docker run --rm -it python:3-alpine sh -c 'pip install kubernetes-typed[client] && python -c "from kubernetes_typed.client import V1PodDict"'
Collecting kubernetes-typed[client]
...
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.11/site-packages/kubernetes_typed/client/__init__.py", line 3, in <module>
    from kubernetes_typed.client.models.admissionregistration_v1_service_reference import AdmissionregistrationV1ServiceReferenceDict
  File "/usr/local/lib/python3.11/site-packages/kubernetes_typed/client/models/__init__.py", line 4, in <module>
    from kubernetes_typed.client.models.admissionregistration_v1_webhook_client_config import AdmissionregistrationV1WebhookClientConfigDict
  File "/usr/local/lib/python3.11/site-packages/kubernetes_typed/client/models/admissionregistration_v1_webhook_client_config.py", line 5, in <module>
    from kubernetes_typed.client import AdmissionregistrationV1ServiceReferenceDict
ImportError: cannot import name 'AdmissionregistrationV1ServiceReferenceDict' from partially initialized module 'kubernetes_typed.client' (most likely due to a circular import) (/usr/local/lib/python3.11/site-packages/kubernetes_typed/client/__init__.py)

I ran simple git bisect and it seems that this actually never worked 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants