AnswerDotAI / AnswerDotAI/nbdev

Unable to create a new nbdev project, concurrency issues? [Mac, 3.12.2]

Open
#1,443 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Jupyter Notebook
Stars
5.3k
Forks
513
Avg merge
2d 30m
Merged PRs (30d)
8

Description

macOS: 14.6.1
Python: 3.12.2

Tried both with global install and fresh clean virtual environment.

First pip install nbdev (successfull)
Then when I run nbdev_new

`repo = nbdev_test # Automatically inferred from git
branch = main # Automatically inferred from git
user = steckoverflow # Automatically inferred from git
author = # Automatically inferred from git
author_email = # Automatically inferred from git
description = nbdev test # Automatically inferred from git
settings.ini created.
concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/site-packages/IPython/core/formatters.py", line 226, in catch_format_error
r = method(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/site-packages/IPython/core/formatters.py", line 347, in __call__
return method()
^^^^^^^^
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/site-packages/nbdev/showdoc.py", line 170, in _repr_markdown_
src = NbdevLookup().code(self.fn)
^^^^^^^^^^^^^
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/site-packages/nbdev/doclinks.py", line 212, in __init__
self.entries = {o.name: _qual_syms(o.resolve()) for o in list(pkg_resources.iter_entry_points(group='nbdev'))
^^^^^^^^^^^
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pkg_resources/__init__.py", line 2752, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/site-packages/fasthtml/__init__.py", line 2, in
from .core import *
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/site-packages/fasthtml/core.py", line 14, in
from .xtend import *
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/site-packages/fasthtml/xtend.py", line 22, in
picolink = (Link(rel="stylesheet", href=picocss),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/site-packages/fasthtml/components.py", line 53, in ft_hx
return ft_html(tag, *c, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/site-packages/fasthtml/components.py", line 45, in ft_html
tag,c,kw = ft(tag, *c, **kwargs)
^^^^^^^^
ValueError: not enough values to unpack (expected 3, got 0)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/concurrent/futures/process.py", line 263, in _process_worker
r = call_item.fn(*call_item.args, **call_item.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/concurrent/futures/process.py", line 212, in _process_chunk
return [fn(*args) for args in chunk]
^^^^^^^^^
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/site-packages/fastcore/parallel.py", line 63, in _call
return g(item)
^^^^^^^
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/site-packages/nbdev/serve_drv.py", line 22, in main
if src.suffix=='.ipynb': exec_nb(src, dst, x)
^^^^^^^^^^^^^^^^^^^^
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/site-packages/nbdev/serve_drv.py", line 16, in exec_nb
cb()(nb)
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/site-packages/nbdev/processors.py", line 291, in __call__
def __call__(self, nb): return self.nb_proc(nb).process()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/site-packages/nbdev/process.py", line 129, in process
for proc in self.procs: self._proc(proc)
^^^^^^^^^^^^^^^^
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/site-packages/nbdev/process.py", line 122, in _proc
for cell in self.nb.cells: self._process_cell(proc, cell)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/site-packages/nbdev/process.py", line 113, in _process_cell
if callable(proc) and not _is_direc(proc): cell = opt_set(cell, proc(cell))
^^^^^^^^^^
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/site-packages/nbdev/processors.py", line 252, in __call__
raise Exception(f"Error{' in notebook: '+title if title else ''} in cell {cell.idx_} :\n{cell.source}") from self.k.exc[1]
Exception: Error in notebook: core in cell 5 :
#| echo: false
#| output: asis
show_doc(foo)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Users/ts/.pyenv/versions/3.12.2/bin/nbdev_new", line 8, in
sys.exit(nbdev_new())
^^^^^^^^^^^
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/site-packages/fastcore/script.py", line 121, in _f
return tfunc(**merge(args, args_from_prog(func, xtra)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/site-packages/nbdev/cli.py", line 119, in nbdev_new
nbdev_readme.__wrapped__()
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/site-packages/nbdev/quarto.py", line 265, in nbdev_readme
cache = proc_nbs(path)
^^^^^^^^^^^^^^
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/site-packages/nbdev/serve.py", line 79, in proc_nbs
parallel(nbdev.serve_drv.main, files, n_workers=n_workers, pause=0.01, **kw)
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/site-packages/fastcore/parallel.py", line 134, in parallel
return L(r)
^^^^
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/site-packages/fastcore/foundation.py", line 100, in __call__
return super().__call__(x, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/site-packages/fastcore/foundation.py", line 108, in __init__
items = listify(items, *rest, use_list=use_list, match=match)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/site-packages/fastcore/basics.py", line 70, in listify
elif is_iter(o): res = list(o)
^^^^^^^
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/concurrent/futures/process.py", line 642, in _chain_from_iterable_of_lists
for element in iterable:
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/concurrent/futures/_base.py", line 619, in result_iterator
yield _result_or_cancel(fs.pop())
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/concurrent/futures/_base.py", line 317, in _result_or_cancel
return fut.result(timeout)
^^^^^^^^^^^^^^^^^^^
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/concurrent/futures/_base.py", line 456, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/Users/ts/.pyenv/versions/3.12.2/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
Exception: Error in notebook: core in cell 5 :
#| echo: false
#| output: asis
show_doc(foo)`

I have exported a GITHUB_TOKEN with generous permissions. Any pointers?

Contributor guide

Open the contributing guide

Research direction

Start by reproducing `nbdev_new` in a clean Python 3.12.2 environment, then trace the reported path through `nbdev/cli.py`, `nbdev/quarto.py`, `nbdev/serve.py`, and `nbdev/serve_drv.py`. Inspect the failing `core` notebook cell and the `nbdev/showdoc.py` interaction with `fasthtml`; done means a new project completes without the traceback on the reported setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.