Skip to content

Doc build fails if IPython is installed system-wide #2372

@hroncok

Description

@hroncok

Hi, I'm trying to update the Fedora RPM package to 5.0.0. Part of the package build process is rebuilding the docs.

When the documentation of notebook-5.0.0 is built, the notebook file docs/source/examples/Notebook/Importing Notebooks.ipynb is evaluated and the following code is run:

import shutil
from IPython.paths import get_ipython_package_dir

utils = os.path.join(get_ipython_package_dir(), 'utils')
shutil.copy(os.path.join("nbpackage", "mynotebook.ipynb"),
            os.path.join(utils, "inside_ipython.ipynb")
)

This of course fails when run under non-root user and IPython is installed system-wide:

PermissionError: [Errno 13] Permission denied: '/usr/lib/python3.6/site-packages/IPython/utils/inside_ipython.ipynb'

You can ignore this error by setting the following in conf.py:

    nbsphinx_allow_errors = True

As a workaround I can use suggested nbsphinx_allow_errors = True, but that may be dangerous as it is set globally, not just for this one file. I'm not yet sure what it does exactly, but the docs might end up rendered with error, so I's rather not use it at all.

What is a benefit of this particular example (putting a notebook inside an existing, already installed module)? Can this section be removed form that example file? (I'll probably end up patching it out in Fedora, as it would never work for regular user anyway, but would rather make it an upstream change.) Thanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions