<p>I have Kubernetes client version 25.3.0. With this I am able to execute below code</p>
<pre class="lang-py prettyprint-override"><code>import kubernetes    
from kubernetes import client
from kubernetes import kubernetes    
print('Hello, world!')
</code></pre>
<p>I have requirement to upgrade Kubernetes client because of some other vulnerability fixes. Now if I upgrade my Kubernetes client version to latest one i.e. 26.1.0 or 27.2.0  and execute the same above code,  I see error:</p>
<pre><code>[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 &quot;test.py&quot;, line 4, in &lt;module&gt;
    from kubernetes import kubernetes
ImportError: cannot import name 'kubernetes'
[root@comfort1 ]#
</code></pre>
<p>Any idea how I can fix this?  I am using Python version 3.6.8</p>

HotDev
<p>The issue is with the line, <code>from kubernetes import kubernetes</code>. The format <code>from x import y</code> is used to explicitly import a module <code>x.y</code> in package <code>x</code>. It does not seem that the <code>kubernetes</code> package contains a <code>kubernetes.kubernetes</code> module. You can either use <code>import kubernetes</code> and access the module like <code>kubernetes.config</code> or <code>kubernetes.utils</code> OR explicitly import the modules you will use with the following:</p>
<pre class="lang-py prettyprint-override"><code>from kubernetes import client, config, [...other modules you need]
</code></pre>
<p>The warning about cryptography is a depreciation warning the <a href="https://pypi.org/project/cryptography/" rel="nofollow noreferrer"><code>cryptography</code></a> package. I had trouble tracking down the exact dependency tree, but it seems that the <a href="https://pypi.org/project/kubernetes/" rel="nofollow noreferrer"><code>kubernetes</code></a> package has an indirect dependency on the <code>cryptography</code> package.  The latest release of <code>cryptography</code> no longer supports Python 3.6. It is recommended that you update to a more modern version of Python.</p>
