skip to Main Content

I have been banging my head on the wall trying to get the following import to work.

from kubernetes import config, client

I pip installed kubernetes==11.0.0

It works perfectly fine on https://repl.it/languages/python3 but getting import error on my CentOS 7 box.
from kubernetes import config, watch, client
ImportError: cannot import name 'config'

I have been using Python for 7-8 years, I am not sure what I am missing.

Thanks!

2

Answers


  1. Chosen as BEST ANSWER

    Found my issue, file name was kubernetes.py. Renamed it and solved issue :|.


  2. It seems that when you name your file kubernetes.py, the import is attempted from that particular file than from the library

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search