Skip to content

ModuleNotFoundError: No module named 'kubernetes.dynamic' #1062

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

Closed
myugan opened this issue Jan 27, 2020 · 9 comments
Closed

ModuleNotFoundError: No module named 'kubernetes.dynamic' #1062

myugan opened this issue Jan 27, 2020 · 9 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@myugan
Copy link

myugan commented Jan 27, 2020

What happened (please include outputs or screenshots):

Cannot execute script from example documentation for list pod.

Traceback (most recent call last):
  File "kube.py", line 1, in <module>
    from kubernetes import client, config
  File "/home/myuga/.local/lib/python3.8/site-packages/kubernetes/__init__.py", line 21, in <module>
    import kubernetes.dynamic
ModuleNotFoundError: No module named 'kubernetes.dynamic'

What you expected to happen:
module cannot load properly

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

Environment:

  • Kubernetes version (kubectl version): v1.17.0
  • OS : Manjaro Linux
  • Python version : 3.8.1
  • Python client version (pip list | grep kubernetes)
@myugan myugan added the kind/bug Categorizes issue or PR as related to a bug. label Jan 27, 2020
@blurLake
Copy link

I have the same error here as well.

@blurLake
Copy link

The error was solved by uninstall kubernetes from pip3 and reinstall using pip3 install kubernetes. The version I am using is kubernetes 10.0.1.

@roycaihw
Copy link
Member

roycaihw commented Mar 2, 2020

/assign @micw523

ref #1035

@micw523
Copy link
Contributor

micw523 commented Mar 2, 2020

Because this adds a new symbolic link (and we did not support importing from base.dynamic directly), I think reinstalling the package is needed.

@roycaihw
Copy link
Member

roycaihw commented Mar 2, 2020

I think it's a bug fix that hasn't been released yet. In 11.0.0b2 we still don't have #1035 included.

On a side note, @micw523 do you know why we didn't add kubernetes.dynamic to setup.py?

python/setup.py

Lines 60 to 63 in 073cf4d

packages=['kubernetes', 'kubernetes.client', 'kubernetes.config',
'kubernetes.watch', 'kubernetes.client.api',
'kubernetes.stream', 'kubernetes.client.models',
'kubernetes.utils', 'kubernetes.client.apis'],

@micw523
Copy link
Contributor

micw523 commented Mar 2, 2020

Ah... I think I simply forgot. That might be the reason why.

@roycaihw
Copy link
Member

roycaihw commented Mar 9, 2020

The fixes will be included in the upcoming 11.0.0 release #1097

@roycaihw
Copy link
Member

Closing the issue as 11.0.0 has been released. Please reopen if you hit any issue

/close

@k8s-ci-robot
Copy link
Contributor

@roycaihw: Closing this issue.

In response to this:

Closing the issue as 11.0.0 has been released. Please reopen if you hit any issue

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

5 participants