Skip to content

multiprocessing in marimo notebooks #1379

@liquidcarbon

Description

@liquidcarbon

When using a module that uses loguru, its logs don't show up in the notebook or stdout with the following error. The catch is that the environment where loguru is installed is fetched during the execution of the notebook.

Any advice handling this?

Exception in callback ConnectionDistributor._on_change()
handle: <Handle ConnectionDistributor._on_change()>
Traceback (most recent call last):
  File "/home/a/Desktop/pup/.pixi/envs/default/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/home/a/Desktop/pup/.pixi/envs/default/lib/python3.12/site-packages/marimo/_utils/distributor.py", line 61, in _on_change
    response = self.input_connection.recv()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/a/Desktop/pup/.pixi/envs/default/lib/python3.12/multiprocessing/connection.py", line 251, in recv
    return _ForkingPickler.loads(buf.getbuffer())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'loguru'
        Are you sure you want to quit? (y/n): 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions