GithubHelp home page GithubHelp logo

Comments (10)

aparnajyothi-y avatar aparnajyothi-y commented on June 20, 2024

Hello @garyo, Thank you for creating this issue and we will look into it :)

from setup-python.

Nuru avatar Nuru commented on June 20, 2024

I'm having the same problem with v5.1.0 on GitHub hosted ubuntu-22.04

      - uses: actions/setup-python@v5
        with:
          python-version: '3.9'
          cache: 'pip' # caching pip dependencies

Logs:

Run actions/setup-python@v5
  with:
    python-version: 3.9
    cache: pip
    check-latest: false
    token: ***
    update-environment: true
    allow-prereleases: false
/usr/bin/docker exec  e65a6dddc9afaa41c11c7df09f0617fc3082b82b82346802ca21d63e222dd840 sh -c "cat /etc/*release | grep ^ID"
Installed versions
  Successfully set up CPython (3.9.19)
Error: Unable to locate executable file: lsb_release. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.

from setup-python.

mahabaleshwars avatar mahabaleshwars commented on June 20, 2024

Hello @garyo, would you mind trying to install lsb-release to see if it addresses the problem you're experiencing? Here are the commands for updating the apt package list and installing lsb-release:

- name : Apt-update 
  run: sudo apt-get update
- name: Install lsb-release
  run: sudo apt-get install -y lsb-release

from setup-python.

garyo avatar garyo commented on June 20, 2024

It all works fine if that package is installed. It does not work on the image I mentioned (aswf/ci-base:2023) which does not install that by default. Images used for CI builds tend to be quite minimal to save space and speed up startup. Running apt-get update on every run will slow down CI builds. Perhaps if we know what you need from lsb_release there may be an alternative way to determine that on more minimal distros.

from setup-python.

Nuru avatar Nuru commented on June 20, 2024

This also happens on Alpine 3.17.3, Debian 11.5-slim, and Red Hat Enterprise Linux 8.9 (Ootpa).

from setup-python.

Nuru avatar Nuru commented on June 20, 2024

Apparently this is only a problem when using pip cache:

const osInfo = await getLinuxInfo();

setup-python/src/utils.ts

Lines 169 to 172 in 82c7e63

export async function getLinuxInfo() {
const {stdout} = await exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], {
silent: true
});

from setup-python.

mahabaleshwars avatar mahabaleshwars commented on June 20, 2024

Hello @garyo,
In this context, the lsb_release command retrieves the Linux operating system's name and version, facilitating the creation of unique cache keys for Python dependencies. This strategy ensures accurate caching and restoration of dependencies, considering the uniqueness of each combination of the operating system, Python version, and dependency file.

Can you consider using the actions/cache action to cache dependencies and speed up your workflows. In the case of Python, it's often used to cache pip packages. The key for the cache is often generated using the hash of requirements.txt (or other dependency files), and the Python version, not lsb_release. Here is an example:

- name: Cache pip
  uses: actions/cache@v4
  with:
    path: ${{ steps.pip-cache.outputs.dir }}
    key: <primaryKey>   # Replace with the computed primaryKey
    restore-keys: <restoreKey>   # Replace with the computed restoreKey

This will cache pip dependencies and reuse them in subsequent runs, reducing the time it takes to install packages.
For any other inquiries or concerns pertaining to rocky-linux, please get in touch with the rocky-linux team.

from setup-python.

garyo avatar garyo commented on June 20, 2024

Sure, I understand what lsb_release does. I expect it wouldn't be hard to get the same info in other ways when that is not available, but if you're not interested in that I'll look at other way to setup python on our CI containers.

from setup-python.

pythoninthegrass avatar pythoninthegrass commented on June 20, 2024

#890 seems related. Will try using actions/cache@v4 in the interim.

from setup-python.

mahabaleshwars avatar mahabaleshwars commented on June 20, 2024

Hello @garyo, we are not planning to alter the usage of lsb_release for cache:pip. The provided solution utilizing actions/cache ensures pip dependencies are cached and reused in subsequent runs, thereby minimizing package installation time.
Please feel free to reach us in case of any concerns.

from setup-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.