openshift/openshift-restclient-python

Unable to import DynamicClient when both openshift-client-python and openshift-restclient-python installed

jinho10 opened this issue · 2 comments

Started with restclient, but found out that exec is not supported there.. so installed openshift-client-python to get object and execute command. however, the library installation seems to screw up the existing restclient... when importing, it shows

    from openshift.dynamic import DynamicClient
  File "/Users/jinhohwang/.pyenv/versions/3.6.10/lib/python3.6/site-packages/openshift/dynamic/__init__.py", line 1, in <module>
    from .client import *  # NOQA
  File "/Users/jinhohwang/.pyenv/versions/3.6.10/lib/python3.6/site-packages/openshift/dynamic/client.py", line 8, in <module>
    from .discovery import EagerDiscoverer, LazyDiscoverer
  File "/Users/jinhohwang/.pyenv/versions/3.6.10/lib/python3.6/site-packages/openshift/dynamic/discovery.py", line 11, in <module>
    from openshift import __version__

is there a way to use both? should I choose one? obviously restclient can't be used for exec...

it is just a simple problem between version and VERSION .. if we just use one, it works ok.

A simple workaround to solve this easily... openshift/openshift-client-python#74
nothing to do in this repo, so we can close this if the PR is merged.

talking with @bradmwilliams, the workaround would not make the two compatible, so even though it is a quick work around for my use case. it may not make sense to merge into main. I will keep my forked repo to do my poc, and find the ultimate solution for this issue. I have to support both openshift and kubernetes, so it may make sense to use kubernetes client only. hope that works well for both.