MyST-NB icon indicating copy to clipboard operation
MyST-NB copied to clipboard

ModuleNotFoundError: No module named 'fastjsonschema'

Open s4m0r4m4 opened this issue 1 year ago • 1 comments

Describe the bug

context When I try to build sphinx docs with myst-nb...

expectation I expected the docs to build.

bug But instead the following error is:

$ jupyter-book build mybook
Running Sphinx v6.2.1

Exception occurred:
  File "/root/.cache/pypoetry/virtualenvs/.../site-packages/nbformat/json_compat.py", line 12, in <module>
    import fastjsonschema
ModuleNotFoundError: No module named 'fastjsonschema'

problem It looks like ipython may now need the [notebook] add-in so that the fastjsonschema dependency is included by default: https://github.com/ipython/ipython/issues/5979

Would have to change this line: https://github.com/executablebooks/MyST-NB/blob/master/pyproject.toml#L40

Reproduce the bug

Set up a project with the following dependencies:

[tool.poetry]
...

[[tool.poetry.source]]
name = "PyPI"
priority = "primary"

[tool.poetry.dependencies]
python = "^3.8"
python-dotenv = "^0.20.0"
requests = "^2.28.1"
pandas = ">1.4.3, <3.0.0"
pathlib = "^1.0.1"
openpyxl = "^3.0.10"
plotly = "^5.11.0"
deprecation = "^2.1.0"
isort = "^5.12.0"
typing-extensions = "^4.7.1"

[tool.poetry.group.dev.dependencies]
black = "^22.6.0"
coverage = "^6.4.2"
mypy = "1.5.0"
pytest = "^7.1.2"
pytest-cov = "^3.0.0"
pylint = "^2.14.5"
taskipy = "^1.10.2"
types-requests = "^2.31.0.2"
types-urllib3 = "^1.26.23"
ipykernel = "^6.23.1"
pytest-xdist = "^3.3.1"
# add dev dependencies with `poetry add --dev` command

[tool.poetry.group.docs]
optional = true

[tool.poetry.group.docs.dependencies]
sphinx = "^6.2.1"
myst-parser = "^1.0.0"
sphinx-autobuild = "^2021.3.14"
sphinx-autodoc-typehints = "^1.12.0"
sphinx-multiversion = "^0.2.4"
sphinx-rtd-theme = "^1.3.0"
myst-nb = {version = "^1.0.0", python = "^3.9"}

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.taskipy.tasks]
get_latest_version = "git tag -l --sort=creatordate |grep -Eo '^[0-9]{1,}.[0-9]{1,}.[0-9]{1,}$' |tail -1"
build_docs = "(export LATEST_RELEASE_TAG=$(task get_latest_version); sphinx-multiversion docs build/html)"
docs = "sphinx-autobuild docs docs/_build/html --watch src"

Run task docs and see the error.

List your environment

No response

s4m0r4m4 avatar May 07 '24 19:05 s4m0r4m4

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

welcome[bot] avatar May 07 '24 19:05 welcome[bot]