setup-python icon indicating copy to clipboard operation
setup-python copied to clipboard

Getting error "attempting to execute the process .../pip"

Open tomdtp opened this issue 2 years ago • 4 comments

Description: I am receiving an error message when running the CI, which is:

Run actions/setup-python@v4

/usr/bin/docker exec  47d5533689e05c9f17b55f1237300dc760ccb1afc3a7608da7cde431b7a12dc3 sh -c "cat /etc/*release | grep ^ID"
Installed versions
/__t/Python/3.10.12/x64/bin/pip cache dir

Error: There was an error when attempting to execute the process '/__t/Python/3.10.12/x64/bin/pip'. This may indicate the process failed to start. Error: spawn /__t/Python/3.10.12/x64/bin/pip ENOENT

Action version: v4

Platform:

  • [x] Ubuntu
  • [ ] macOS
  • [ ] Windows

Runner type:

  • [x] Hosted
  • [ ] Self-hosted

Tools version: 3.10.12

Repro steps:
I am using a container based on https://github.com/OSGeo/gdal/pkgs/container/gdal (ubuntu-small-latest) in my build. I had to install lsb_release already to get it running, but now I am getting the error mentioned above.

In my action I am using:

    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: "3.10"
          cache: "pip"

Expected behavior: It should work just fine.

Actual behavior: It fails with the error mentioned above.

tomdtp avatar Aug 23 '23 12:08 tomdtp

Hello @tomdtp. Thank you for your report. We'll take a look at the issue.

dmitry-shibanov avatar Aug 23 '23 12:08 dmitry-shibanov

Getting a similar error when trying to set up Python with caching enabled after installing lsb_release. This feels like an extension of #556.

test.yaml
name: Tests

on:
  - push

jobs:
  test:
    runs-on: ubuntu-latest
    container:
      image: python:3.11.1
    defaults:
      run:
        working-directory: ./app

    env:
      DB_ENGINE: django.contrib.gis.db.backends.postgis
      # ... Rm'd for brevity

    services:
      postgres:
        image: postgis/postgis:13-3.2
        env:
          POSTGRES_DB: db
          POSTGRES_USER: postgres
          POSTGRES_PASSWORD: postgres
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
        ports:
          - 5432:5432

    steps:
      - uses: actions/checkout@v2

      - name: Install GDAL
        run: |
          apt-get update -y
          apt-get install -y libgdal-dev lsb-release
          apt-get clean all

      - name: Setup Python
        uses: actions/setup-python@v4
        with:
          python-version: 3.11.5
          cache: pip

      # ... Rm'd for brevity
Build Output
Run actions/setup-python@v4
  with:
    python-version: 3.11.5
    cache: pip
    check-latest: false
    token: ***
    update-environment: true
    allow-prereleases: false
  env:
    DB_ENGINE: django.contrib.gis.db.backends.postgis
/usr/bin/docker exec  f4a9c232bcec12996e4393e33b93ed4b06b33a83f39bb6fe1edd4eec2c86e62c sh -c "cat /etc/*release | grep ^ID"
Installed versions
  Successfully set up CPython (3.11.5)
/__t/Python/3.11.5/x64/bin/pip cache dir
Error: There was an error when attempting to execute the process '/__t/Python/3.11.5/x64/bin/pip'. This may indicate the process failed to start. Error: spawn /__t/Python/3.11.5/x64/bin/pip ENOENT

alukach avatar Sep 12 '23 17:09 alukach

I have the same error. I am using a fairly small base container too.

krishnakumarg1984 avatar Sep 27 '23 11:09 krishnakumarg1984

Same error, is there any workaround or fix for this?

agajdosi avatar Sep 16 '24 08:09 agajdosi