nbsphinx icon indicating copy to clipboard operation
nbsphinx copied to clipboard

'NoneType' object has no attribute 'argv' error with clean notebook

Open nlgranger opened this issue 7 years ago • 9 comments

On a clean notebook with nbsphinx_execute = 'auto', running the notebook fails with the following error:

python -m sphinx -b html docs docs/_build
Running Sphinx v1.7.9
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 1 source files that are out of date
updating environment: 0 added, 1 changed, 0 removed
reading sources... [100%] examples/minibatch_iterator
Notebook error:
AttributeError in examples/minibatch_iterator.ipynb:
'NoneType' object has no attribute 'argv'
(venv3)

I'm trying to use nbsphinx on https://github.com/nlgranger/SeqTools (improved_doc branch) on a clean python 3 virtual env with the packages IPython, ipykernel, nbsphinx, Pillow and the project itself.

nlgranger avatar Sep 07 '18 17:09 nlgranger

Is it possible that this is just an error in your notebook? Can you please try to provide a minimal example notebook (with no additional dependencies) that shows this error?

mgeier avatar Sep 08 '18 08:09 mgeier

Sure, here is a self contained mini project, I'm trying to build the doc with python -m sphinx docs docs/_build: test.zip

nlgranger avatar Sep 08 '18 09:09 nlgranger

Thanks for the mini example. I cannot reproduce your error. It runs successful except for this unrelated warning:

WARNING: toctree contains reference to document 'test' that doesn't have a title: no link will be generated

Could you try running your notebook with nbconvert --execute?

mgeier avatar Sep 08 '18 16:09 mgeier

If you mean jupyter nbconvert --execute it works without issues.

nlgranger avatar Sep 08 '18 19:09 nlgranger

I also have the error with a python 3.5 conda environment, can't make much sense out of it...

nlgranger avatar Sep 08 '18 19:09 nlgranger

Can this be related to nbconvert 5.4 and https://github.com/jupyter/nbconvert/issues/878?

astrojuanlu avatar Sep 08 '18 21:09 astrojuanlu

@Juanlu001 Yes it is.

mgeier avatar Sep 09 '18 10:09 mgeier

@nlgranger Thanks for checking!

If you mean jupyter nbconvert --execute it works without issues.

I meant python3 -m nbconvert --execute, but that does the same thing.

mgeier avatar Sep 09 '18 10:09 mgeier

This has been fixed in https://github.com/jupyter/nbconvert/pull/924.

Now, we just have to wait for a new nbconvert release (most likely version 5.5).

mgeier avatar Dec 08 '18 09:12 mgeier