microsoft / microsoft/markitdown

Unable to install package "ModuleNotFoundError: No module named 'packaging.licenses'"

Open
#1,046 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
186k
Forks
13.7k
Avg merge
1d 4h
Merged PRs (30d)
49

Description

I'm running Ubuntu 22.04.5 LTS on WSL, when trying to execute pip install -e packages/markitdown I receive the following error:

Defaulting to user installation because normal site-packages is not writeable
Obtaining file:///home/adamsharif/repos/markitdown/packages/markitdown
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Installing backend dependencies ... done
  Preparing editable metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing editable metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      Traceback (most recent call last):
        File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 191, in prepare_metadata_for_build_editable
          return hook(metadata_directory, config_settings)
        File "/tmp/pip-build-env-hmk0ad27/overlay/local/lib/python3.10/dist-packages/hatchling/build.py", line 142, in prepare_metadata_for_build_editable
          f.write(builder.config.core_metadata_constructor(builder.metadata, extra_dependencies=extra_dependencies))
        File "/tmp/pip-build-env-hmk0ad27/overlay/local/lib/python3.10/dist-packages/hatchling/metadata/spec.py", line 546, in construct_metadata_file_2_4
          if metadata.core.license:
        File "/tmp/pip-build-env-hmk0ad27/overlay/local/lib/python3.10/dist-packages/hatchling/metadata/core.py", line 677, in license
          from packaging.licenses import canonicalize_license_expression
      ModuleNotFoundError: No module named 'packaging.licenses'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

It's a fresh clone of the repo and I have full access to the cloned directory - running version pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)

Already tried pip cache purge and a re-run but no change.

Does anyone know how I can resolve this please?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with pip install -e packages/markitdown on Ubuntu 22.04 with the reported pip and Python versions. Inspect the editable-install build metadata path and its Hatchling dependency environment; done means the package installs successfully without the packaging.licenses error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.