Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 2

`sndfile` library not found when running actions on `ubuntu-latest`

Solved! Go to Solution.

I perform python unit tests in my GitHub Actions. This is my first action, and the operation stopped on the first run because `sndfile` library is not found in the system. This is the full log trace:

 

 
 
Run flake8 aaapi tests
running test
running egg_info
creating aaapi.egg-info
writing aaapi.egg-info/PKG-INFO
writing dependency_links to aaapi.egg-info/dependency_links.txt
writing top-level names to aaapi.egg-info/top_level.txt
writing manifest file 'aaapi.egg-info/SOURCES.txt'
reading manifest file 'aaapi.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '__pycache__' found under directory '*'
warning: no previously-included files matching '*.py[co]' found under directory '*'
warning: no files found matching '*.jpg' under directory 'docs'
warning: no files found matching '*.png' under directory 'docs'
warning: no files found matching '*.gif' under directory 'docs'
writing manifest file 'aaapi.egg-info/SOURCES.txt'
running build_ext
error: sndfile library not found

 

This is likely due to the packages that I used in my python code, and I found out that the system need the package `libsndfile1-dev` installed in the ubuntu system. I assume that I cannot do this because I probably do not have the root access to the container of the action. How do I resolve this? Thank you.

1 Reply
Highlighted
Solution
GitHub Partner
Message 2 of 2

Re: `sndfile` library not found when running actions on `ubuntu-latest`

GitHub-hosted runners has administrative privileges.

The Linux and macOS virtual machines both run using passwordless sudo. When you need to execute commands or install tools that require more privileges than the current user, you can use sudo without needing to provide a password.

You can refer to https://help.github.com/en/actions/automating-your-workflow-with-github-actions/virtual-environments...

>>  I assume that I cannot do this because I probably do not have the root access to the container of the action.

Wht's the meaning of the container of the action? Could you please show your workflow yml content? 

I tested in my side, I can use command sudo apt-get install libsndfile1-dev to install libsndfile1-dev to the hosted ubuntu runner machine .

 

name: install sndfile

on: push

jobs:

  job1:

    runs-on: ubuntu-latest

    steps:

     - run: |

        sudo apt-get install libsndfile1-dev