[BUG] pyproject.toml: name, version not recognized (UNKNOWN 0.0.0)
See original GitHub issuesetuptools version
62.1.0
Python version
3.10
OS
Ubuntu 22.04
Additional environment information
No response
Description
I recently started using Python 3.10 and found the pyproject.toml
-based installation lacking. It now doesn’t reads name
and version
incorrectly:
pip install .
Defaulting to user installation because normal site-packages is not writeable
Processing /path/to/foobar
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: UNKNOWN
Building wheel for UNKNOWN (pyproject.toml) ... done
Created wheel for UNKNOWN: filename=UNKNOWN-0.0.0-py3-none-any.whl size=1227 sha256=sgrhihehihg
Stored in directory: /path/to/.cache/pip/wheels/dsliughredshg
Successfully built UNKNOWN
Installing collected packages: UNKNOWN
Attempting uninstall: UNKNOWN
Found existing installation: UNKNOWN 0.0.0
Uninstalling UNKNOWN-0.0.0:
Successfully uninstalled UNKNOWN-0.0.0
Successfully installed UNKNOWN-0.0.0
Any idea why this might be? Perhaps package that’s missing in my 3.10 installation? I was surprised not to get an error message here either.
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:25 (14 by maintainers)
Top Results From Across the Web
pyproject.toml won't find project name with setuptools python
At the time the question was asked, setuptools did not have support for writing its configuration in a pyproject.toml file (PEP 621).
Read more >Problems using pyproject.toml : r/learnpython - Reddit
So it seems it doesn't read the pyproject.toml. I'm pretty sure the name and version meta data in correct under the project table....
Read more >Dependency scanning fails for setuptools project that ... - GitLab
My project contains a setup.cfg and a pyproject.toml . Unfortunately, it does not get recognized by the Dependency scanning. Does this issue ...
Read more >build backend is missing the 'build_editable' hook. - You.com
done ERROR: Project file:///home/developer/src/packaging-test has a 'pyproject.toml' and its build backend is missing the 'build_editable' hook. Since it does ...
Read more >History - setuptools 65.6.3.post20221216 documentation
Setuptools will adopt the name of the top-level package (or module in the case of single-module distributions), only when name is not explicitly...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
TLDR; On Ubuntu 22.04 (Jammy) ensure the environment variable
DEB_PYTHON_INSTALL_LAYOUT=deb_system
before installing a PEP621 compliant project with pip and setuptools.This issue is occurring on Jammy because
pip
is unable to get an accurate list of system package directories to remove from its temporary build environment’ssys.path
. As a result, when the temporary build env’ssite/sitecustomize.py
script runs/usr/lib/python3/dist-packages
is left at the end of sys.path, before theoverlay
andnormal
paths are appended, thus placing it before those dirs in the search path. This means Jammy’s debian packaged setuptools (at version 59) is found and loaded ahead of whatever version thepyproject.toml
requested. That version does not support PEP621 and is unable to extractname
andversion
metadata, resulting inUNKNOWN-0.0.0
.This was not an issue on 20.04 (Focal) because the
get_purelib
andget_platlib
logic insidepip/_internal/locations/__init__.py
switched at runtime between using the older distutils and newer sysconfig modules for determining purelib and platlib paths. That choice is based on the value ofsysconfig._PIP_USE_SYSCONFIG
, which only defaults toFalse
if the python version is less than 3.10. The older distuils knew how to deal with Debian’s install scheme layout, where the newer sysconfig doesn’t unless the env varDEB_PYTHON_INSTALL_LAYOUT
is set to eitherdeb
ordeb_system
.This means this is a distro configuration/packaging issue, but I’m posting this comment on a closed bug because this bug report comes up as the top result when googling for this issue.
I think this person had the same problem 😃 https://pypi.org/project/UNKNOWN/