question

JoseJoabRomeroHumba-3204 avatar image
0 Votes"
JoseJoabRomeroHumba-3204 asked MayankBargali-MSFT commented

How can I install a program in my Azure Function

I am working with sox in python to modify some audios, I've added sox in the requeriments file but when I deploy and call the function i get the next error: "Result: Failure Exception: FileNotFoundError: [Errno 2] No such file or directory: 'sox' " i think this problem happend because I have to install sox in the machine where the function works with the next command "apt-get install sox" but I don't know how to do it.

I would greatly appreciate the help


ref: https://pypi.org/project/sox/

azure-functions
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@JoseJoabRomeroHumba-3204
As we are mainly responsible for general question of Microsoft Teams, your question is not in our scope. I will remove office-teams-linux-itpro tag. Thanks for your understanding.

0 Votes 0 ·

1 Answer

MayankBargali-MSFT avatar image
0 Votes"
MayankBargali-MSFT answered MayankBargali-MSFT commented

Updated:

We can see that under the instructions here it talks about installing it via apt-get first. Looks like using pip doesn't install it from the source, which is unfortunate here because otherwise, remote Build would have handled it.

In this case, it looks like build native dependency will also not help. Using a custom container would be a better approach in this case.



@JoseJoabRomeroHumba-3204 You need to define your package in requirements.txt file of your project.

 azure-functions -->Default
 sox
· 6
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

yes of course but I already had it written in the requirements.txt :C

94136-requeriments.png


0 Votes 0 ·
requeriments.png (17.3 KiB)

@JoseJoabRomeroHumba-3204 Can you share the code snippet to reproduce the issue so I can review it.

0 Votes 0 ·

yes of course. this is the function that I call in my main

 def formatAudio():
     tfm = sox.Transformer()
     tfm.set_output_format(rate=16000, channels=1)
     tfm.build('/tmp/audio.wav', '/tmp/audiosox.wav')
0 Votes 0 ·
Show more comments