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

Build failure due to pyproject.toml #1205

Closed
Evidlo opened this issue Dec 23, 2021 · 3 comments
Closed

Build failure due to pyproject.toml #1205

Evidlo opened this issue Dec 23, 2021 · 3 comments
Labels
invalid Invalid report (user error, upstream issue, etc).

Comments

@Evidlo
Copy link

Evidlo commented Dec 23, 2021

[evan@blackbox python-markdown] pip install -e .
Obtaining file:///home/evan/resources/python-markdown
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
ERROR: Exception:
Traceback (most recent call last):
  File "/home/evan/resources/venv3/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 164, in exc_logging_wrapper
    status = run_func(*args)
  File "/home/evan/resources/venv3/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 205, in wrapper
    return func(self, options, args)
  File "/home/evan/resources/venv3/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 338, in run
    requirement_set = resolver.resolve(
  File "/home/evan/resources/venv3/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 73, in resolve
    collected = self.factory.collect_root_requirements(root_reqs)
  File "/home/evan/resources/venv3/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 468, in collect_root_requirements
    req = self._make_requirement_from_install_req(
  File "/home/evan/resources/venv3/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 430, in _make_requirement_from_install_req
    cand = self._make_candidate_from_link(
  File "/home/evan/resources/venv3/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 186, in _make_candidate_from_link
    self._editable_candidate_cache[link] = EditableCandidate(
  File "/home/evan/resources/venv3/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 306, in __init__
    super().__init__(
  File "/home/evan/resources/venv3/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 156, in __init__
    self.dist = self._prepare()
  File "/home/evan/resources/venv3/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 225, in _prepare
    dist = self._prepare_distribution()
  File "/home/evan/resources/venv3/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 316, in _prepare_distribution
    return self._factory.preparer.prepare_editable_requirement(self._ireq)
  File "/home/evan/resources/venv3/lib/python3.9/site-packages/pip/_internal/operations/prepare.py", line 599, in prepare_editable_requirement
    dist = _get_prepared_distribution(
  File "/home/evan/resources/venv3/lib/python3.9/site-packages/pip/_internal/operations/prepare.py", line 58, in _get_prepared_distribution
    abstract_dist.prepare_distribution_metadata(finder, build_isolation)
  File "/home/evan/resources/venv3/lib/python3.9/site-packages/pip/_internal/distributions/sdist.py", line 45, in prepare_distribution_metadata
    self.req.isolated_editable_sanity_check()
  File "/home/evan/resources/venv3/lib/python3.9/site-packages/pip/_internal/req/req_install.py", line 524, in isolated_editable_sanity_check
    and not self.supports_pyproject_editable()
  File "/home/evan/resources/venv3/lib/python3.9/site-packages/pip/_internal/req/req_install.py", line 257, in supports_pyproject_editable
    return "build_editable" in self.pep517_backend._supported_features()
  File "/home/evan/resources/venv3/lib/python3.9/site-packages/pip/_vendor/pep517/wrappers.py", line 159, in _supported_features
    return self._call_hook('_supported_features', {})
  File "/home/evan/resources/venv3/lib/python3.9/site-packages/pip/_vendor/pep517/wrappers.py", line 332, in _call_hook
    raise BackendUnavailable(data.get('traceback', ''))
pip._vendor.pep517.wrappers.BackendUnavailable: Traceback (most recent call last):
  File "/home/evan/resources/venv3/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 89, in _build_backend
    obj = import_module(mod_path)
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 5, in <module>
    import distutils.core
  File "/home/evan/resources/venv3/lib/python3.9/site-packages/_distutils_hack/__init__.py", line 92, in create_module
    return importlib.import_module('setuptools._distutils')
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named 'setuptools._distutils'

Deleting pyproject.toml is a workaround. Related issues:

pytest-dev/pytest-forked#47
pypa/pip#8823
pypa/setuptools#2353

@facelessuser
Copy link
Collaborator

This feels like a pip or setuptools problem, not a problem we need to directly address. At the very least, it is nice to know this issue exists so we can at least point people at the real issue. I'm not sure we should bother doing anything directly though and should probably just wait for it to get fixed upstream.

@mitya57
Copy link
Collaborator

mitya57 commented Dec 24, 2021

It looks like it tries to use setuptools from distro packages, not from your virtualenv. And it is probably incompatible with pip from virtualenv.

Can you run pip install --upgrade setuptools in your environment? I believe it should help.

@waylan waylan added more-info-needed More information needs to be provided. needs-confirmation The alleged behavior needs to be confirmed. labels Dec 27, 2021
@waylan
Copy link
Member

waylan commented Apr 18, 2023

This should no longer be relevant after #1324.

@waylan waylan closed this as not planned Won't fix, can't repro, duplicate, stale Apr 18, 2023
@waylan waylan added invalid Invalid report (user error, upstream issue, etc). and removed more-info-needed More information needs to be provided. needs-confirmation The alleged behavior needs to be confirmed. labels Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Invalid report (user error, upstream issue, etc).
Projects
None yet
Development

No branches or pull requests

4 participants