python icon indicating copy to clipboard operation
python copied to clipboard

Unable to import Kubernetes with latest python Kubernetes client

Open Dsiddhesh opened this issue 1 year ago • 6 comments

What happened (please include outputs or screenshots): Unable to import Kubernetes with latest python Kubernetes client. What you expected to happen:

Should be able to import

How to reproduce it (as minimally and precisely as possible): With Kubernetes client of v 27.2.0 or 26.1.0 if i try to import kubernetes then it gives error like below Code test.py

import kubernetes    
from kubernetes import client
from kubernetes import kubernetes    
print('Hello, world!')

[root@comfort1 ]# python3 test.py /usr/local/lib/python3.6/site-packages/google/auth/crypt/_cryptography_rsa.py:22: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography. The next release of cryptography will remove support for Python 3.6. import cryptography.exceptions Traceback (most recent call last): File "test.py", line 4, in from kubernetes import kubernetes ImportError: cannot import name 'kubernetes' [root@comfort1 ]#

Anything else we need to know?: Same code worked with Kubernetes client 25.3.0. I need to upgrade to latest Kubernetes client to resolve a vulnarability

Environment:

  • Kubernetes version (kubectl version): 26.1.0, 27.2.0
  • OS (e.g., MacOS 10.13.6): RHEL 8
  • Python version (python --version) 3.6.8
  • Python client version (pip list | grep kubernetes) kubernetes 27.2.0

Dsiddhesh avatar Aug 03 '23 09:08 Dsiddhesh

Even after upgrading to Python 3.8 faced same issue.

Dsiddhesh avatar Aug 04 '23 11:08 Dsiddhesh

/assign @yliaog

roycaihw avatar Aug 30 '23 16:08 roycaihw

i can use the client 27.2.0 with python 3.9.1 without any issue.

after the installation, the examples given below can be run successfully. https://github.com/kubernetes-client/python#examples

yliaog avatar Aug 30 '23 18:08 yliaog

I am having the same issues with kubernetes 19.15.0

curiousEnough avatar Aug 31 '23 01:08 curiousEnough

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Jan 27 '24 09:01 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Feb 26 '24 10:02 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-triage-robot avatar Mar 27 '24 11:03 k8s-triage-robot

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

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.

k8s-ci-robot avatar Mar 27 '24 11:03 k8s-ci-robot