errata-ai / vale-action

:octocat: The official GitHub Action for Vale -- install, manage, and run Vale with ease.
MIT License
202 stars 51 forks source link

error: externally-managed-environment on ubuntu ubuntu-24.04 #128

Closed axel7083 closed 3 weeks ago

axel7083 commented 4 months ago

When using the latest version we are getting the following

/usr/bin/pip install docutils
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

    See /usr/share/doc/python3.12/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
Error: Error: The process '/usr/bin/pip' failed with exit code 1

workflow file

name: Validate website language on pull request

on:
  pull_request:
    paths:
      - 'website/**'

jobs:
  vale:
    name: runner / vale
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@v4
      - uses: errata-ai/vale-action@v2.1.0
        env:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
        with:
          files: website
          fail_on_error: false
kayx23 commented 1 month ago

Same error on ubuntu-24.04. Following.

Current fix: reverting to 22.04.

zhangtbj commented 1 month ago

Same error on ubuntu-24.04. Following.

Current fix: reverting to 22.04.

👍 It also works for me after rollback to the ubuntu 22.04

burgerdev commented 1 month ago

This workaround allows staying on 24.04:

name: reviewdog
on: [pull_request]

jobs:
  vale:
    name: runner / vale
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@v3
      - run: |
          venv="$HOME/.local/share/venv"
          python3 -m venv "$venv"
          echo "$venv/bin" >> $GITHUB_PATH
      - uses: errata-ai/vale-action@reviewdog
ekohl commented 1 month ago

For what it's worth, GitHub is rolling out an update of ubuntu-latest to refer to 24.04. This is happening in stages, so not everyone sees it at the same time. Quoting https://github.blog/changelog/2024-09-25-actions-new-images-and-ubuntu-latest-changes/

The ubuntu-latest label will migrate to Ubuntu 24 over the course of the next month, beginning September 23rd and finishing on October 30th. During migration, you can determine if your job has migrated by viewing the “Runner Image” information in the “Set up job” step of your Actions logs.

Users who follow the usage example in README will run into this problem more and more.

jdkato commented 1 month ago

These dependencies are only required in certain cases (using reStructuredText or AsciiDoc) and rarely together, so I think in the next release I will stop installing them.

This means that users of those formats will have to install one on their own, but this is already true for DITA.