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

Install with poetry install broken due to missing pip executable #11624

Open
carmenbianca opened this issue Sep 27, 2024 · 1 comment
Open

Install with poetry install broken due to missing pip executable #11624

carmenbianca opened this issue Sep 27, 2024 · 1 comment
Labels
Support Support question

Comments

@carmenbianca
Copy link

Details

Expected Result

Using the following config:

build:
  os: ubuntu-22.04
  tools:
    python: "3.9"
  jobs:
    post_create_environment:
      - python -m pip install poetry
    post_install:
      - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH python -m poetry install --with
        docs

The build should successfully use Poetry, as documented here

Actual Result

The build fails on the poetry install step.

The build also fails when removing the python -m substrings from the above configuration.

This is the output of the failed step:

Installing dependencies from lock file

Package operations: 49 installs, 9 updates, 0 removals

  - Downgrading certifi (2024.8.30 -> 2024.6.2)
  [... shortened for your convenience]
  - Installing sphinxcontrib-apidoc (0.5.0)

Installing the current project: reuse (4.0.3)
Preparing build environment with build-system requirements poetry-core>=1.1.0

Command ['/tmp/tmp9lc98fl8/.venv/bin/python', '/home/docs/checkouts/readthedocs.org/user_builds/reuse/envs/latest/lib/python3.8/site-packages/virtualenv/seed/wheels/embed/pip-24.2-py3-none-any.whl/pip', 'install', '--disable-pip-version-check', '--ignore-installed', '--no-input', 'poetry-core>=1.1.0'] errored with the following return code 2

Output:
/tmp/tmp9lc98fl8/.venv/bin/python: can't open file '/home/docs/checkouts/readthedocs.org/user_builds/reuse/envs/latest/lib/python3.8/site-packages/virtualenv/seed/wheels/embed/pip-24.2-py3-none-any.whl/pip': [Errno 2] No such file or directory

This started occurring at some point after 2024-09-05 (latest successful build), with 2024-09-10 as the earliest build that fails. There were no relevant changes to Sphinx, the RTD config, Poetry, dependencies, etc etc etc between these two dates.

Specifically, what appears to happen is this: As part of running poetry install, the build-system dependencies from pyproject.yaml must be installed. Snippet:

[build-system]
requires = ["poetry-core>=1.1.0"]
build-backend = "poetry.core.masonry.api"

As far as I can divine, Poetry (or Python?) delegates the installation of this dependency to Pip, and Pip then fails to install poetry-core because pip does not exist at a given path. I assume that:

  • Pip is either not installed in $READTHEDOCS_VIRTUALENV_PATH;
  • or it somehow divines a completely incorrect path where pip is (not) located.
@carmenbianca
Copy link
Author

carmenbianca commented Sep 27, 2024

For reasons that are far beyond me, running poetry lock to re-generate poetry.lock has fixed the issue. See this PR: fsfe/reuse-tool#1081

Some notes:

I don't know if this is a bug on RTD's part. I will leave the issue open even though it is resolved for me, because this seems rather unusual to me, and the error message appears completely unrelated.

@stsewd stsewd added the Support Support question label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support Support question
Projects
None yet
Development

No branches or pull requests

2 participants