Skip to content

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

Closed

Description

@myugan

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)

Activity

  1. added
    kind/bugCategorizes issue or PR as related to a bug.
    on Jan 27, 2020
  2. blurLake commented on Feb 12, 2020

    @blurLake

    I have the same error here as well.

  3. blurLake commented on Feb 12, 2020

    @blurLake

    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.

  4. roycaihw commented on Mar 2, 2020

    @roycaihw
    Member

    /assign @micw523

    ref #1035

  5. micw523 commented on Mar 2, 2020

    @micw523
    Contributor

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

  6. roycaihw commented on Mar 2, 2020

    @roycaihw
    Member

    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'],

  7. micw523 commented on Mar 2, 2020

    @micw523
    Contributor

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

  8. roycaihw commented on Mar 9, 2020

    @roycaihw
    Member

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

  9. roycaihw commented on Mar 16, 2020

    @roycaihw
    Member

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

    /close

  10. k8s-ci-robot commented on Mar 16, 2020

    @k8s-ci-robot
    Contributor

    @roycaihw: Closing this issue.

    Details

    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

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