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

missing package nbformat #3293

Open
arthrod opened this issue Dec 25, 2024 · 3 comments
Open

missing package nbformat #3293

arthrod opened this issue Dec 25, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@arthrod
Copy link

arthrod commented Dec 25, 2024

Describe the bug

Hi team,

I used the option auto-save to ipynb, and got this error:

ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi
result = await app( # type: ignore[func-returns-value]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in call
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/starlette/applications.py", line 112, in call
await self.middleware_stack(scope, receive, send)
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/starlette/middleware/errors.py", line 187, in call
raise exc
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/starlette/middleware/errors.py", line 165, in call
await self.app(scope, receive, _send)
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/marimo/_server/api/auth.py", line 217, in call
return await super().call(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/starlette/middleware/sessions.py", line 85, in call
await self.app(scope, receive, send_wrapper)
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/starlette/middleware/base.py", line 185, in call
with collapse_excgroups():
^^^^^^^^^^^^^^^^^^^^
File "/Users/arthrod/.local/share/uv/python/cpython-3.12.7-macos-aarch64-none/lib/python3.12/contextlib.py", line 158, in exit
self.gen.throw(value)
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/starlette/_utils.py", line 82, in collapse_excgroups
raise exc
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/starlette/middleware/base.py", line 187, in call
response = await self.dispatch_func(request, call_next)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/marimo/_server/api/middleware.py", line 145, in dispatch
return await call_next(request)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/starlette/middleware/base.py", line 163, in call_next
raise app_exc
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/starlette/middleware/base.py", line 149, in coro
await self.app(scope, receive_or_disconnect, send_no_error)
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/starlette/middleware/authentication.py", line 48, in call
await self.app(scope, receive, send)
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/starlette/middleware/cors.py", line 93, in call
await self.simple_response(scope, receive, send, request_headers=headers)
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/starlette/middleware/cors.py", line 144, in simple_response
await self.app(scope, receive, send)
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/marimo/_server/api/middleware.py", line 117, in call
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/marimo/_server/api/middleware.py", line 338, in call
await self.app(scope, receive, send)
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/marimo/_server/api/middleware.py", line 338, in call
await self.app(scope, receive, send)
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 62, in call
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
raise exc
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/starlette/routing.py", line 715, in call
await self.middleware_stack(scope, receive, send)
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/starlette/routing.py", line 735, in app
await route.handle(scope, receive, send)
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/starlette/routing.py", line 460, in handle
await self.app(scope, receive, send)
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/starlette/routing.py", line 715, in call
await self.middleware_stack(scope, receive, send)
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/starlette/routing.py", line 735, in app
await route.handle(scope, receive, send)
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/starlette/routing.py", line 288, in handle
await self.app(scope, receive, send)
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/starlette/routing.py", line 76, in app
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
raise exc
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/starlette/routing.py", line 73, in app
response = await f(request)
^^^^^^^^^^^^^^^^
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/marimo/_server/router.py", line 54, in wrapper_func
response = await func(request=request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/starlette/authentication.py", line 75, in async_wrapper
return await func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/marimo/_server/api/endpoints/export.py", line 312, in auto_export_as_ipynb
ipynb, _filename = Exporter().export_as_ipynb(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/marimo/_server/export/exporter.py", line 172, in export_as_ipynb
DependencyManager.nbformat.require(
File "/Users/arthrod/.cache/uv/archive-v0/bGPMI2TMGNPif7Ql6PhW8/lib/python3.12/site-packages/marimo/_dependencies/dependencies.py", line 57, in require
raise ModuleNotFoundError(message) from None
ModuleNotFoundError: nbformat is required to convert marimo notebooks to ipynb.

Problem solved after installing nbformat, obviously.

I ran in a sandbox environment using uv marimo new --sandbox --token

Environment

{
"marimo": "0.10.7",
"OS": "Darwin",
"OS Version": "24.1.0",
"Processor": "arm",
"Python Version": "3.13.1",
"Binaries": {
"Browser": "131.0.6778.205",
"Node": "v23.5.0"
},
"Dependencies": {
"click": "8.1.7",
"docutils": "0.21.2",
"itsdangerous": "2.2.0",
"jedi": "0.19.2",
"markdown": "3.7",
"narwhals": "1.19.1",
"packaging": "24.2",
"psutil": "6.1.1",
"pygments": "2.18.0",
"pymdown-extensions": "10.13",
"pyyaml": "6.0.2",
"ruff": "0.8.4",
"starlette": "0.42.0",
"tomlkit": "0.13.2",
"typing-extensions": "4.12.2",
"uvicorn": "0.34.0",
"websockets": "14.1"
},
"Optional Dependencies": {
"duckdb": "1.1.3",
"polars": "1.18.0"
}
}

Code to reproduce

No response

@arthrod arthrod added the bug Something isn't working label Dec 25, 2024
@mscolnick
Copy link
Contributor

This error is expected since it is an optional dependency. But we plan on 1) making it easier to install these dependencies and 2) making the errors clearer (we don't need this stack trace).

@arthrod
Copy link
Author

arthrod commented Dec 25, 2024

Thanks, will close the issue then. My only suggestion is: user clicks to save in ipynb on gui - - > proceeds with installation

@arthrod arthrod closed this as completed Dec 25, 2024
@mscolnick
Copy link
Contributor

mscolnick commented Dec 25, 2024

Yep we want to do that, I will leave this issue open so we can track the improved UX around it

Related to #3113

@mscolnick mscolnick reopened this Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants