-
I am stuck on this, not sure what happened from last week to this week that suddenly this is failing. I have rebuilt the virtual environment several times, with no change in the behavior. Internet searches reveal that this is something that was seen around 2017 and should not be present anymore in anything close to current. Normally the program is not run in a virtual environment, I am just using it to do the 'python -m build' as some of the python modules needed are not available as Debian packages for Anti-X. $ python --version
Python 3.9.2
$ pip --version
pip 22.3.1 from /mnt/aviary/home/malmberg/work/d-rats/D-Rats/coyote_venv/lib/python3.9/site-packages/pip (python 3.9)
$ python -m build
Traceback (most recent call last):
File "/mnt/aviary/home/malmberg/work/d-rats/D-Rats/coyote_venv/lib/python3.9/site-packages/build/__main__.py", line 373, in main
built = build_call(
File "/mnt/aviary/home/malmberg/work/d-rats/D-Rats/coyote_venv/lib/python3.9/site-packages/build/__main__.py", line 233, in build_package_via_sdist
sdist = _build(isolation, builder, outdir, 'sdist', config_settings, skip_dependency_check)
File "/mnt/aviary/home/malmberg/work/d-rats/D-Rats/coyote_venv/lib/python3.9/site-packages/build/__main__.py", line 143, in _build
return _build_in_isolated_env(builder, outdir, distribution, config_settings)
File "/mnt/aviary/home/malmberg/work/d-rats/D-Rats/coyote_venv/lib/python3.9/site-packages/build/__main__.py", line 107, in _build_in_isolated_env
with _IsolatedEnvBuilder() as env:
File "/mnt/aviary/home/malmberg/work/d-rats/D-Rats/coyote_venv/lib/python3.9/site-packages/build/env.py", line 99, in __enter__
if _should_use_virtualenv():
File "/mnt/aviary/home/malmberg/work/d-rats/D-Rats/coyote_venv/lib/python3.9/site-packages/build/env.py", line 58, in _should_use_virtualenv
import packaging.requirements
ModuleNotFoundError: No module named 'packaging.requirements'
ERROR No module named 'packaging.requirements' Selected output from pip freeze:
pyprojecdt.toml: [build-system]
requires = ["setuptools>=40"]
build-backend = "setuptools.build_meta"
[project]
name = "D-Rats"
description = "A communications tool for D-STAR"
readme = "README.md"
requires-python = ">=3.7"
license = {text = "GPL-3"}
dynamic = ["version"]
dependencies = [
"lxml",
"pycairo",
"PyGObject",
"pyserial",
"Pillow",
"geopy",
"feedparser"
]
[tool.towncrier]
directory = "changes"
package = 'd_rats.version'
[tool.setuptools]
packages = ['d_rats', 'd_rats.map', 'd_rats.sessions', 'd_rats.ui' ]
[tool.setuptools.dynamic]
version = {attr = "d_rats.version.DRATS_PEP440_VERSION"} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
In your traceback it's visible that the exception originates in pypa/build (PEP 517 build front-end), not setuptools (PEP 517 build back-end). This is what requires the packaging library. I suppose it's missing from your system for some reason. I'd expect |
Beta Was this translation helpful? Give feedback.
-
Found the issue. I had created a packaging directory with an init.py in it in my project. The python -m build importing that directory instead of the Pypi packaging module.
I have a python script in the packaging directory that runs towncrier and msgfmt on all the message source files since I do not know how to get the pyproject.toml to do those steps. |
Beta Was this translation helpful? Give feedback.
Found the issue.
I had created a packaging directory with an init.py in it in my project.
Once I deleted the init.py from the directory, the python -m build started working.
The python -m build importing that directory instead of the Pypi packaging module.