jupyter / jupyter_kernel_test

A tool for testing Jupyter kernels

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error when running tests: AttributeError: 'NoneType' object has no attribute 'metadata'

jnahmias opened this issue · comments

Hello,
I am working on packaging JKT 0.4.2 for Debian. I tried to run the tests and get the following error output:

$ python3.9 -m unittest -v
ERROR

======================================================================
ERROR: setUpClass (jupyter_kernel_test.KernelTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./jupyter_kernel_test/__init__.py", line 23, in setUpClass
    cls.km, cls.kc = start_new_kernel(kernel_name=cls.kernel_name)
  File "/usr/lib/python3/dist-packages/jupyter_client/manager.py", line 645, in start_new_kernel
    km.start_kernel(**kwargs)
  File "/usr/lib/python3/dist-packages/jupyter_client/utils.py", line 26, in wrapped
    raise e
  File "/usr/lib/python3/dist-packages/jupyter_client/utils.py", line 23, in wrapped
    return loop.run_until_complete(future)
  File "/usr/lib/python3/dist-packages/nest_asyncio.py", line 70, in run_until_complete
    return f.result()
  File "/usr/lib/python3.9/asyncio/futures.py", line 201, in result
    raise self._exception
  File "/usr/lib/python3.9/asyncio/tasks.py", line 256, in __step
    result = coro.send(None)
  File "/usr/lib/python3/dist-packages/jupyter_client/manager.py", line 362, in _async_start_kernel
    raise e
  File "/usr/lib/python3/dist-packages/jupyter_client/manager.py", line 347, in _async_start_kernel
    kernel_cmd, kw = await ensure_async(self.pre_start_kernel(**kw))
  File "/usr/lib/python3/dist-packages/jupyter_client/utils.py", line 26, in wrapped
    raise e
  File "/usr/lib/python3/dist-packages/jupyter_client/utils.py", line 23, in wrapped
    return loop.run_until_complete(future)
  File "/usr/lib/python3/dist-packages/nest_asyncio.py", line 70, in run_until_complete
    return f.result()
  File "/usr/lib/python3.9/asyncio/futures.py", line 201, in result
    raise self._exception
  File "/usr/lib/python3.9/asyncio/tasks.py", line 256, in __step
    result = coro.send(None)
  File "/usr/lib/python3/dist-packages/jupyter_client/manager.py", line 306, in _async_pre_start_kernel
    self.provisioner = KPF.instance(parent=self.parent).create_provisioner_instance(
  File "/usr/lib/python3/dist-packages/jupyter_client/provisioning/factory.py", line 89, in create_provisioner_instance
    provisioner_cfg = self._get_provisioner_config(kernel_spec)
  File "/usr/lib/python3/dist-packages/jupyter_client/provisioning/factory.py", line 146, in _get_provisioner_config
    env_provisioner = kernel_spec.metadata.get('kernel_provisioner', {})
AttributeError: 'NoneType' object has no attribute 'metadata'

----------------------------------------------------------------------
Ran 0 tests in 0.007s

FAILED (errors=1)

Any idea what could be causing this? I've got the following installed:

$ dpkg -l python3-jsonschema python3-jupyter-client python3-setuptools python3-ipykernel
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                   Version      Architecture Description
+++-======================-============-============-====================================================================
ii  python3-ipykernel      6.2.0-1      all          IPython kernel for Jupyter (Python 3)
ii  python3-jsonschema     3.2.0-3      all          An(other) implementation of JSON Schema (Draft 3 and 4) - Python 3.x
ii  python3-jupyter-client 7.1.0-1      all          Jupyter protocol client APIs (Python 3)
ii  python3-setuptools     59.4.0-1     all          Python3 Distutils Enhancements

Thanks for the report @jnahmias! This should be fixed by #67