← All tasks
pythonkubernetes-client/python #2009Not a task: already works

oauthlib (Python lib in requirements.txt) needs upgrade

envgap__kubernetes-client__python-2009

01 / FAILURE SIGNATURE

As reported upstream

ImportError: cannot import name 'SIGNATURE_RSA' from 'oauthlib.oauth1'
Not a benchmark task.
  • The project already builds and runs before the fix, so there is nothing to repair.

02 / ENVIRONMENT RECIPE

Base commit
1a0cb469528e6b2bdeb3eb2c06945f1c22303dfd
Manifest
requirements.txt
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

kubernetes-client/python #2009 · read the original issue
**What happened (please include outputs or screenshots)**:



Trying to deploy kubernetes module on an updated Rocky 9 remote machine result in the following error : 



```

Failed to import the required Python library (kubernetes) on master's Python /usr/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter

```



This error is present despite having `kubernetes` Python library previously installed on the remote machine.



If we login on the target machine, fire a Python3 interpreter, and try to manually `import kubernetes`, we got the following error :



```

ImportError: cannot import name 'SIGNATURE_RSA' from 'oauthlib.oauth1'

```



**What you expected to happen**:



It should just work ?



**Anything else we need to know?**:



The bug resides in the `kubernetes` module dependencies.

Your current `requirements.txt` contains  `requests-oauthlib # ISC`.

Going on `requests-oauthlib` repo, we can see that their `requirements.txt` contains the following : `oauthlib[signedtoken]==3.1.1` (available here https://github.com/requests/requests-oauthlib/blob/master/requirements.txt).

Upgrading `oauthlib` Python library to `>=3.2.0` solves the problem.



**Environment**:

```bash

$ pip list | grep kubernetes

kubernetes          25.3.0

```
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]