Hi, I have an issue with nbdev version 2.3.9
When running nbdev.nbdev_export()
in a notebook cell this is the output:
---------------------------------------------------------------------------
JSONDecodeError Traceback (most recent call last)
Cell In[8], line 2
1 #| hide
----> 2 import nbdev; nbdev.nbdev_export()
File ~/mambaforge/lib/python3.10/site-packages/fastcore/script.py:110, in call_parse.<locals>._f(*args, **kwargs)
107 @wraps(func)
108 def _f(*args, **kwargs):
109 mod = inspect.getmodule(inspect.currentframe().f_back)
--> 110 if not mod: return func(*args, **kwargs)
111 if not SCRIPT_INFO.func and mod.__name__=="__main__": SCRIPT_INFO.func = func.__name__
112 if len(sys.argv)>1 and sys.argv[1]=='': sys.argv.pop(1)
File ~/mambaforge/lib/python3.10/site-packages/nbdev/doclinks.py:137, in nbdev_export(path, **kwargs)
135 if os.environ.get('IN_TEST',0): return
136 files = nbglob(path=path, **kwargs)
--> 137 for f in files: nb_export(f)
138 add_init(get_config().lib_path)
139 _build_modidx()
File ~/mambaforge/lib/python3.10/site-packages/nbdev/export.py:48, in nb_export(nbname, lib_path, procs, debug, mod_maker, name)
46 if lib_path is None: lib_path = get_config().lib_path
47 exp = ExportModuleProc()
---> 48 nb = NBProcessor(nbname, [exp]+L(procs), debug=debug)
...
354 except StopIteration as err:
--> 355 raise JSONDecodeError("Expecting value", s, err.value) from None
356 return obj, end
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
When running nbdev_export
in the terminal this is the output:
Traceback (most recent call last):
File "/home/arthur/mambaforge/bin/nbdev_export", line 10, in <module>
sys.exit(nbdev_export())
File "/home/arthur/mambaforge/lib/python3.10/site-packages/fastcore/script.py", line 119, in _f
return tfunc(**merge(args, args_from_prog(func, xtra)))
File "/home/arthur/mambaforge/lib/python3.10/site-packages/nbdev/doclinks.py", line 137, in nbdev_export
for f in files: nb_export(f)
File "/home/arthur/mambaforge/lib/python3.10/site-packages/nbdev/export.py", line 48, in nb_export
nb = NBProcessor(nbname, [exp]+L(procs), debug=debug)
File "/home/arthur/mambaforge/lib/python3.10/site-packages/nbdev/process.py", line 92, in __init__
self.nb = read_nb(path) if nb is None else nb
File "/home/arthur/mambaforge/lib/python3.10/site-packages/execnb/nbio.py", line 57, in read_nb
res = dict2nb(_read_json(path, encoding='utf-8'))
File "/home/arthur/mambaforge/lib/python3.10/site-packages/execnb/nbio.py", line 16, in _read_json
return loads(Path(self).read_text(encoding=encoding, errors=errors))
File "/home/arthur/mambaforge/lib/python3.10/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/home/arthur/mambaforge/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/arthur/mambaforge/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
When running nbdev_clean
in the terminal this is the output:
home/arthur/mambaforge/lib/python3.10/site-packages/nbdev/clean.py:115: UserWarning: Failed to clean notebook
warn(f'{warn_msg}')
/home/arthur/mambaforge/lib/python3.10/site-packages/nbdev/clean.py:116: UserWarning: 'cells'
warn(e)
Any help would be greatly appreciated as I’ve seen similar errors in the forums but not with these commands