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

Papermill ValueError("No language found in notebook and no override provided.") #584

Closed
filippoteodoro opened this issue Mar 14, 2021 · 2 comments

Comments

@filippoteodoro
Copy link

I am trying to use Papermill on this notebook https://github.com/filippoteodoro/rep/blob/master/Prices%20Predictions/Price_Prediction_Multivariate_Prophet.ipynb

By executing this command:
(base) filippoteodoro@Filippos-MacBook-Pro ~ % papermill /Users/filippoteodoro/Price_Prediction_Multivariate_Prophet.ipynb s3://filippoteodoro/Price_Prediction_Multivariate_Prophet.ipynb -p x 10

I am setting x as a placeholder parameter even though I don't need it just because I if I don't I get:
ValueError: Required parameter key not set

And I get this error. I don't understand what It means by "No language found in notebook and no override provided."

(base) filippoteodoro@Filippos-MacBook-Pro ~ % papermill /Users/filippoteodoro/Price_Prediction_Multivariate_Prophet.ipynb s3://filippoteodoro/Price_Prediction_Multivariate_Prophet.ipynb -p x 10 
Input Notebook:  /Users/filippoteodoro/Price_Prediction_Multivariate_Prophet.ipynb
Output Notebook: s3://filippoteodoro/Price_Prediction_Multivariate_Prophet.ipynb
Traceback (most recent call last):
  File "/Users/filippoteodoro/opt/miniconda3/bin/papermill", line 8, in <module>
    sys.exit(papermill())
  File "/Users/filippoteodoro/opt/miniconda3/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/Users/filippoteodoro/opt/miniconda3/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/Users/filippoteodoro/opt/miniconda3/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/filippoteodoro/opt/miniconda3/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Users/filippoteodoro/opt/miniconda3/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/filippoteodoro/opt/miniconda3/lib/python3.8/site-packages/papermill/cli.py", line 250, in papermill
    execute_notebook(
  File "/Users/filippoteodoro/opt/miniconda3/lib/python3.8/site-packages/papermill/execute.py", line 94, in execute_notebook
    nb = parameterize_notebook(
  File "/Users/filippoteodoro/opt/miniconda3/lib/python3.8/site-packages/papermill/parameterize.py", line 80, in parameterize_notebook
    language = nb_language(nb, language)
  File "/Users/filippoteodoro/opt/miniconda3/lib/python3.8/site-packages/papermill/utils.py", line 82, in nb_language
    raise ValueError("No language found in notebook and no override provided.")
ValueError: No language found in notebook and no override provided.
@MSeal
Copy link
Member

MSeal commented Mar 15, 2021

So colab generated notebooks are sometimes not specifying a language anywhere in the metadata of the notebook. This means papermill doesn't know what language to translate the -p x 10 argument into. To get around this you can pass the --language python (or -l python) argument to tell papermill that it is in-fact a python notebook. I'll add a ping to the colab issue around the missing metadata.

@filippoteodoro
Copy link
Author

Thank you so much!

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

No branches or pull requests

2 participants