Bug 266855 - devel/py-nbformat: 5.6.1 fails to open ipynb files because of missing nbformat.v*.schema.json files
Summary: devel/py-nbformat: 5.6.1 fails to open ipynb files because of missing nbforma...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Po-Chuan Hsieh
URL:
Keywords: needs-qa, regression
Depends on:
Blocks:
 
Reported: 2022-10-05 17:13 UTC by p5B2EA84B3
Modified: 2022-10-13 12:03 UTC (History)
4 users (show)

See Also:
p5B2EA84B3: maintainer-feedback? (python)
koobs: maintainer-feedback? (sunpoet)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description p5B2EA84B3 2022-10-05 17:13:30 UTC
After py39-nbformat upgraded: 5.4.0 -> 5.6.1
ipynb files saved with version 5.4.0 cannot be opened anymore.
Comment 1 Osamu Matsuda 2022-10-11 07:00:55 UTC
I have the same problem with py-nbformat 5.6.1.

In addition, it does not install /usr/local/lib/python3.9/site-packages/nbformat/v4/nbformat.v4*.schema.json files.  As a consequence, when I tried to open a new session with python3 on jupyter-notebook, I got the following error.

Creating Notebook Failed

An error occured while creating a new notebook.

Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/
tornado/web.py", line 1713, in _execute result = await result File "/usr/local/l
ib/python3.9/site-packages/tornado/gen.py", line 776, in run yielded = self.gen.
throw(*exc_info) # type: ignore File "/usr/local/lib/python3.9/site-packages/not
ebook/services/contents/handlers.py", line 212, in post yield self._new_untitled
(path, type=type, ext=ext) File "/usr/local/lib/python3.9/site-packages/tornado/gen.py", line 769, in run value = future.result() File "/usr/local/lib/python3.9/site-packages/tornado/gen.py", line 234, in wrapper yielded = ctx_run(next, result) File "/usr/local/lib/python3.9/site-packages/notebook/services/contents/handlers.py", line 161, in _new_untitled model = yield maybe_future(self.contents_manager.new_untitled(path=path, type=type, ext=ext)) File "/usr/local/lib/python3.9/site-packages/notebook/services/contents/manager.py", line 395, in new_untitled return self.new(model, path) File "/usr/local/lib/python3.9/site-packages/notebook/services/contents/manager.py", line 414, in new model['content'] = new_notebook() File "/usr/local/lib/python3.9/site-packages/nbformat/v4/nbbase.py", line 170, in new_notebook validate(nb) File "/usr/local/lib/python3.9/site-packages/nbformat/v4/nbbase.py", line 40, in validate return validate_orig(node, ref=ref, version=nbformat) File "/usr/local/lib/python3.9/site-packages/nbformat/validator.py", line 494, in validate for error in iter_validate( File "/usr/local/lib/python3.9/site-packages/nbformat/validator.py", line 612, in iter_validate validator = get_validator(version, version_minor, relax_add_props=relax_add_props) File "/usr/local/lib/python3.9/site-packages/nbformat/validator.py", line 65, in get_validator schema_json = _get_schema_json(v, version=version, version_minor=version_minor) File "/usr/local/lib/python3.9/site-packages/nbformat/validator.py", line 104, in _get_schema_json with open(schema_path) as f: FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.9/site-packages/nbformat/v4/nbformat.v4.5.schema.json'
Comment 2 p5B2EA84B3 2022-10-11 21:17:05 UTC
(In reply to Osamu Matsuda from comment #1)
I confirm that this is the same I saw. 

I was too much in stress when the error prevented me to get my work done timely.
Comment 3 Osamu Matsuda 2022-10-12 03:33:16 UTC
As a workaround, I tried to fetch py39-nbformat-5.4.0.pkg from the packages, extract it, and copy nbformat.v4* files to 
/usr/local/lib/python3.9/site-packages/nbformat/v4

I haven't checked its appropriateness and even don't know what it means, but at least I can load ipynb files saved with 5.4.0.

I hope the problem will be solved in a right way soon.
Comment 4 Osamu Matsuda 2022-10-12 13:45:31 UTC
In fact, these necessary "nbformat.v4*.json" files are also there in /usr/ports/devel/py-nbformat/work-py39/nbformat-5.6.1/nbformat/v4 during the build of nbformat-5.6.1.  So copying these missing files to /usr/local/lib/python3.9/site-packages/nbformat/v4 would be reasonable.
Comment 5 p5B2EA84B3 2022-10-12 18:17:41 UTC
In directory /usr/local/lib/python3.9/site-packages/nbformat/v3
file nbformat.v3.schema.json is missing too.
Comment 6 p5B2EA84B3 2022-10-12 19:01:20 UTC
Trying to create a new Notebook fails too:

Creating Notebook Failed
An error occurred while creating a new notebook.

Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/tornado/web.py", line 1713, in _execute result = await result File "/usr/local/lib/python3.9/site-packages/tornado/gen.py", line 776, in run yielded = self.gen.throw(*exc_info) # type: ignore File "/usr/local/lib/python3.9/site-packages/notebook/services/contents/handlers.py", line 212, in post yield self._new_untitled(path, type=type, ext=ext) File "/usr/local/lib/python3.9/site-packages/tornado/gen.py", line 769, in run value = future.result() File "/usr/local/lib/python3.9/site-packages/tornado/gen.py", line 234, in wrapper yielded = ctx_run(next, result) File "/usr/local/lib/python3.9/site-packages/notebook/services/contents/handlers.py", line 161, in _new_untitled model = yield maybe_future(self.contents_manager.new_untitled(path=path, type=type, ext=ext)) File "/usr/local/lib/python3.9/site-packages/notebook/services/contents/manager.py", line 395, in new_untitled return self.new(model, path) File "/usr/local/lib/python3.9/site-packages/notebook/services/contents/manager.py", line 414, in new model['content'] = new_notebook() File "/usr/local/lib/python3.9/site-packages/nbformat/v4/nbbase.py", line 170, in new_notebook validate(nb) File "/usr/local/lib/python3.9/site-packages/nbformat/v4/nbbase.py", line 40, in validate return validate_orig(node, ref=ref, version=nbformat) File "/usr/local/lib/python3.9/site-packages/nbformat/validator.py", line 494, in validate for error in iter_validate( File "/usr/local/lib/python3.9/site-packages/nbformat/validator.py", line 612, in iter_validate validator = get_validator(version, version_minor, relax_add_props=relax_add_props) File "/usr/local/lib/python3.9/site-packages/nbformat/validator.py", line 65, in get_validator schema_json = _get_schema_json(v, version=version, version_minor=version_minor) File "/usr/local/lib/python3.9/site-packages/nbformat/validator.py", line 104, in _get_schema_json with open(schema_path) as f: FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.9/site-packages/nbformat/v4/nbformat.v4.5.schema.json'
Comment 7 commit-hook freebsd_committer freebsd_triage 2022-10-13 11:59:19 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=235dea12c2cc162ccd3816b8ecad4db884aff510

commit 235dea12c2cc162ccd3816b8ecad4db884aff510
Author:     Ruslan Makhmatkhanov <rm@FreeBSD.org>
AuthorDate: 2022-10-13 11:57:14 +0000
Commit:     Ruslan Makhmatkhanov <rm@FreeBSD.org>
CommitDate: 2022-10-13 11:57:14 +0000

    devel/py-nbformat: install schema files

    This fixes jupyter runtime, as reported in PR.

    PR:             266855
    Reported by:    p5B2EA84B3@t-online.de
    With hat:       python

 devel/py-nbformat/Makefile       | 1 +
 devel/py-nbformat/files/setup.py | 5 +++++
 2 files changed, 6 insertions(+)
Comment 8 Ruslan Makhmatkhanov freebsd_committer freebsd_triage 2022-10-13 12:03:00 UTC
Some custom setup.py is used to make our nbformat package. And for some reason it does not install schema files. Make it to do so.