question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to install the python client

See original GitHub issue

What happened (please include outputs or screenshots): Tried to install the python client: Error 1: When trying to install through - python setup.py install

Switched to a new branch 'release-11.0'
M       kubernetes/base
Branch 'release-11.0' set up to track remote branch 'release-11.0' from 'origin'.
PS D:\python> python setup.py install
running install
running bdist_egg
running egg_info
writing kubernetes.egg-info\PKG-INFO
writing dependency_links to kubernetes.egg-info\dependency_links.txt
writing requirements to kubernetes.egg-info\requires.txt
writing top-level names to kubernetes.egg-info\top_level.txt
error: supposed package directory 'kubernetes\config' exists, but is not a directory

Error 2: While installing from pip

PS D:\python> python -m examples.api_discovery.py
Traceback (most recent call last):
  File "D:\Softwares\Anaconda3\lib\runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "D:\Softwares\Anaconda3\lib\runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "D:\Kubernetes open source - Python client\Python\python\examples\api_discovery.py", line 20, in <module>
    from kubernetes import client, config
  File "D:\Kubernetes open source - Python client\Python\python\kubernetes\__init__.py", line 20, in <module>
    import kubernetes.config
ModuleNotFoundError: No module named 'kubernetes.config'

What you expected to happen: Run the examples given for the python client

How to reproduce it (as minimally and precisely as possible):

  1. For error 1: git clone --recursive https://github.com/kubernetes-client/python.git cd python python setup.py install

  2. For error 2: pip install kubernetes python -m examples.api_discovery

Anything else we need to know?: The path : python/kubernetes/config is a file instead of a directory as the Error 1 snippet suggests https://github.com/kubernetes-client/python/blob/master/kubernetes/config

Environment:

  • Kubernetes version (kubectl version):
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.0", GitCommit:"9e991415386e4cf155a24b1da15becaa390438d8", GitTreeState:"clean", BuildDate:"2020-03-25T14:58:59Z", GoVersion:"go1.13.8", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.3", GitCommit:"2e7996e3e2712684bc73f0dec0200d64eec7fe40", GitTreeState:"clean", BuildDate:"2020-05-20T12:43:34Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
  • OS (e.g., MacOS 10.13.6): Windows 10
  • Python version (python --version): Python 3.7.3
  • Python client version (pip list | grep kubernetes): 11.0.0b2

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Invictus17commented, Jul 13, 2020

Hi, please check this document for additional installation instructions if you’re installing from the source on Windows.

Since you might have had an incomplete installation of the Python client, I’d suggest trying to use pip to remove it first, clean out the corresponding folder in the Python library, and perform an reinstall.

Thanks @micw523 before doing that I just removed the library using pip and then did pip install Kubernetes. This time it worked and I was able to install the python client successfully. Closing this issue.

1reaction
micw523commented, Jul 7, 2020

Hi, please check this document for additional installation instructions if you’re installing from the source on Windows.

Since you might have had an incomplete installation of the Python client, I’d suggest trying to use pip to remove it first, clean out the corresponding folder in the Python library, and perform an reinstall.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Fixed] ModuleNotFoundError: No module named 'google'
Solution Idea 1: Install Library google-api-python-client ... The most likely reason is that Python doesn't provide google-api-python-client in its standard ...
Read more >
Cannot install googleapiclient on PyCharm - Stack Overflow
I think you're just using the wrong name. Try pip install google-api-python-client as specified here.
Read more >
Can't install the python client - Bitcraze Forums
Hi, Try installing without dev (pip install -e.[qt5]), if the problem only comes from cx_freeze it will work. Cx_freeze is only needed if...
Read more >
Installing Python Modules (Legacy version) — Python 3.11.1 ...
Note. This guide only covers the basic tools for building and distributing extensions that are provided as part of this version of Python....
Read more >
Python Installation - Earth Engine - Google Developers
Python Package Installer: pip install earthengine-api --upgrade. Here is a short script that tests if you have working installation: import ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found