Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'language_info' #519

Closed
yogevyuval opened this issue Jul 5, 2020 · 6 comments
Closed

KeyError: 'language_info' #519

yogevyuval opened this issue Jul 5, 2020 · 6 comments

Comments

@yogevyuval
Copy link

I'm sorry for the lack of information or way to reproduce, but that's all the information I have:

While running a notebook we run many times, we got the following exception:

File "/usr/local/lib/python3.7/site-packages/papermill/execute.py", line 106, in execute_notebook
    **engine_kwargs
  File "/usr/local/lib/python3.7/site-packages/papermill/engines.py", line 49, in execute_notebook_with_engine
    return self.get_engine(engine_name).execute_notebook(nb, kernel_name, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/papermill/engines.py", line 343, in execute_notebook
    cls.execute_managed_notebook(nb_man, kernel_name, log_output=log_output, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/papermill/engines.py", line 402, in execute_managed_notebook
    return PapermillNotebookClient(nb_man, **final_kwargs).execute()
  File "/usr/local/lib/python3.7/site-packages/papermill/clientwrap.py", line 40, in execute
    self.nb.metadata['language_info'] = info_msg['content']['language_info']

Any idea why content would not have that key?

@MSeal
Copy link
Member

MSeal commented Jul 8, 2020

Yes, so the metadata format technically doesn't require that the language or kernel fields be provided. However without them we can't A) choose what kernel to run (the UI prompts you) and B) can't know what language to translate parameters into.

Ideally we should raise a clearer message to this effect. I'll mark it as an enhancement issue for new contributors to be able to tackle.

@rgbkrk
Copy link
Member

rgbkrk commented Nov 3, 2020

To help diagnose this can you:

  • post the metadata field from the notebook (you don't have to include the whole notebook)
  • run jupyter kernelspec list --json and paste the output here

@alex-treebeard
Copy link

I was looking at picking this up as my first contribution but I haven't been able to reproduce with missing metadata fields as @MSeal describes.

It appears the line that threw the exception runs after executing the notebook:
https://github.com/nteract/papermill/blob/main/papermill/clientwrap.py#L47

Is there still an error message fix needed here as described?

@yogevyuval
Copy link
Author

This did not happen since posting this, so I have no new information to share. I will close this for now and reopen if issue rises again

@mgasner
Copy link
Contributor

mgasner commented Dec 10, 2020

We are also hitting this in CI, with no apparent relevant changes.

@nannau
Copy link

nannau commented Dec 11, 2020

I just recently had this. For me, I think ipykernel v5.4.0 breaks it.

Reverting to ipykernel==5.3.4 seems to resolve it for me. That might give some hints. 🤔

senecameeks added a commit to quantumlib/Cirq that referenced this issue Nov 14, 2023
Add back original fix to known issue nteract/papermill#519
senecameeks added a commit to quantumlib/Cirq that referenced this issue Nov 15, 2023
* Update start.ipynb

Update the start notebook with the new start notebook that details how to run against our hardware. Notably, only people with access can run circuits against our hardware.

* Update start.ipynb

lint

* Update start.ipynb

attach --pre flag to cirq install for stable version

* Update start.ipynb

Put in default value for processor_id

* Update start.ipynb

add Black as default. This _shouldn't_ run against actual hardware since a valid project_id is never specified. A valid `processor_id` however is needed to pass the CI.

* Update start.ipynb

populate default project_id

* set virtual=True to pass CI check

* Update start.ipynb

make default processor_id an empty string now that `virtual=True` is set

* Update start.ipynb

add back processor_id so it matches current merged version

* Update start.ipynb

rm `cirq --pre` install

* Update start.ipynb

delete overriding instance of `engine`

* Update start.ipynb

fix

* Update start.ipynb

nit

* Update start.ipynb

Add back original fix to known issue nteract/papermill#519

* Update start.ipynb

resolve nit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants