jupyterhub / kubespawner

Kubernetes spawner for JupyterHub
https://jupyterhub-kubespawner.readthedocs.io
BSD 3-Clause "New" or "Revised" License
536 stars 301 forks source link

ImportError with kubespawner 0.10.1 and kubernetes 10.0 #342

Closed dbricare closed 4 years ago

dbricare commented 4 years ago

I received this error when trying to launch jupyterhub on a kubernetes cluster with the latest release kubespawner==0.10.1 and kubernetes==10.0.

Looks like they made changes to the beta kubernetes python API.

There are two workarounds:

[E 2019-08-02 22:27:22.848 JupyterHub app:2482]
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.6/site-packages/jupyterhub/app.py", line 2479, in launch_instance_async
        await self.initialize(argv)
      File "/opt/conda/lib/python3.6/site-packages/jupyterhub/app.py", line 2088, in initialize
        self.load_config_file(self.config_file)
      File "</opt/conda/lib/python3.6/site-packages/decorator.py:decorator-gen-5>", line 2, in load_config_file
      File "/opt/conda/lib/python3.6/site-packages/traitlets/config/application.py", line 87, in catch_config_error
        return method(app, *args, **kwargs)
      File "/opt/conda/lib/python3.6/site-packages/traitlets/config/application.py", line 598, in load_config_file
        raise_config_file_errors=self.raise_config_file_errors,
      File "/opt/conda/lib/python3.6/site-packages/traitlets/config/application.py", line 562, in _load_config_files
        config = loader.load_config()
      File "/opt/conda/lib/python3.6/site-packages/traitlets/config/loader.py", line 457, in load_config
        self._read_file_as_dict()
      File "/opt/conda/lib/python3.6/site-packages/traitlets/config/loader.py", line 489, in _read_file_as_dict
        py3compat.execfile(conf_filename, namespace)
      File "/opt/conda/lib/python3.6/site-packages/ipython_genutils/py3compat.py", line 198, in execfile
        exec(compiler(f.read(), fname, 'exec'), glob, loc)
      File "/srv/brixauthenticator/jupyterhub_config.py", line 8, in <module>
        import kubespawner
      File "/opt/conda/lib/python3.6/site-packages/kubespawner/__init__.py", line 15, in <module>
        from kubespawner.spawner import KubeSpawner
      File "/opt/conda/lib/python3.6/site-packages/kubespawner/spawner.py", line 40, in <module>
        from kubespawner.objects import make_pod, make_pvc
      File "/opt/conda/lib/python3.6/site-packages/kubespawner/objects.py", line 11, in <module>
        from kubernetes.client.models import (
    ImportError: cannot import name 'V1beta1Ingress'
dbricare commented 4 years ago

Just posted this in case anyone else ran into this issue. Marking as closed.