Skip to content

Commit d7584c5

Browse files
committed
Added kubernetes.leaderelection in packages list to fix No module named 'kubernetes.leaderelection' error
To reproduce: Make sure to create a file outside of checked out python repo directory. $ cat hello_k8s.py import kubernetes kubernetes.config.load_kube_config() k8s = kubernetes.client.CoreV1Api() print("Listing pods with their IPs:") ret = k8s.list_pod_for_all_namespaces(watch=False) for i in ret.items: print("%s\t%s\t%s" % (i.status.pod_ip, i.metadata.namespace, i.metadata.name)) python hello_k8s.py Traceback (most recent call last): File "hello_k8s.py", line 1, in <module> import kubernetes File "<frozen zipimport>", line 259, in load_module File "anaconda3/lib/python3.8/site-packages/kubernetes-17.0.0_snapshot-py3.8.egg/kubernetes/__init__.py", line 25, in <module> ModuleNotFoundError: No module named 'kubernetes.leaderelection'
1 parent cbc2a2d commit d7584c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
'kubernetes.watch', 'kubernetes.client.api',
6262
'kubernetes.stream', 'kubernetes.client.models',
6363
'kubernetes.utils', 'kubernetes.client.apis',
64-
'kubernetes.dynamic'],
64+
'kubernetes.dynamic', 'kubernetes.leaderelection'],
6565
include_package_data=True,
6666
long_description="Python client for kubernetes http://kubernetes.io/",
6767
classifiers=[

0 commit comments

Comments
 (0)