Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'packaging' #1756

Closed
papr opened this issue Apr 8, 2022 · 2 comments
Closed

ModuleNotFoundError: No module named 'packaging' #1756

papr opened this issue Apr 8, 2022 · 2 comments

Comments

@papr
Copy link

papr commented Apr 8, 2022

nbconvert relies on packaging in nbconvert.utils.version but does not specify packaging as a direct dependency.

Instead, packaging was installed via bleach<5. Starting with version 5, bleach no longer relies on packaging (see mozilla/bleach#621). As a result, nbconvert fails importing packaging in a fresh install.

python3.10 -m venv .venv
source .venv/bin/activate
pip install nbconvert
python -m jupyter nbconvert --to markdown example.ipynb --ExtractOutputPreprocessor.enabled=False
 Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.10.4/x64/bin/jupyter-nbconvert", line 5, in <module>
    from nbconvert.nbconvertapp import main
  File "/opt/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages/nbconvert/__init__.py", line 4, in <module>
    from .exporters import *
  File "/opt/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages/nbconvert/exporters/__init__.py", line 3, in <module>
    from .html import HTMLExporter
  File "/opt/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages/nbconvert/exporters/html.py", line 26, in <module>
    from nbconvert.filters.highlight import Highlight2HTML
  File "/opt/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages/nbconvert/filters/__init__.py", line 6, in <module>
    from .markdown import *
  File "/opt/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages/nbconvert/filters/markdown.py", line 23, in <module>
    from .pandoc import convert_pandoc
  File "/opt/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages/nbconvert/filters/pandoc.py", line 1, in <module>
    from nbconvert.utils.pandoc import pandoc
  File "/opt/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages/nbconvert/utils/pandoc.py", line 12, in <module>
    from nbconvert.utils.version import check_version
  File "/opt/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages/nbconvert/utils/version.py", line 11, in <module>
    from packaging.version import Version
ModuleNotFoundError: No module named 'packaging'

Nbconvert version: 6.4.5

The solution would be to add packaging as a requirement.

@ReubenFrankel
Copy link

See #1754

@blink1073
Copy link
Member

Fixed by #1754

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants