Trying to Run Audio File Analysis Streamlit App on Local Host but Erroring Out

I downloaded a streamlit tutorial (with all associated github code) that does analysis on and displays audio files. I am able to deploy to Streamlit cloud successfully using the tutorial’s code.

Link to App: https://share.streamlit.io/pinzhi000/audio_visualization/main/visualize_transformation.py
Github: https://github.com/pinzhi000/audio_visualization

But I want to go through the tutorial’s code line by line to really understand what each block of code is doing. So when I try to run the code on my local machine using “streamlit run visualize_transformation.py” I get the following command line / terminal error:

I know it’s something with the pip install of libraries as there are a lot of imported audio related libraries in the code. But when I try to do something like pip install librosa I get this result:

Please help … I’m really stuck on what to do, thx

Edit: Please take a look at the github link to see all required packages and requirements. I’m not sure how to properly install or load them into my command line (especially the packages).

I don’t see anything suspicious in the libraries in your github repo.
Only your local environment seems to have a problem.
Have you tried the force reinstall of numpy?
I don’t use anaconda, but if everything doesn’t help, can’t you just create a new env if necessary?

I assume you are using windows on your local system?
I think you only need ffmpeg. Either install ffmpeg on your system and make it available in your PATH or just download ffmpeg.exe and place it in the root folder of your streamlit application.

Another solution would be to use Docker. Are you familiar with Docker and do you have Docker Desktop installed on your windows machine? If yes, i could also provide a quick solution.

1 Like

appreciate the reply

  • I am using Windows 10
  • I did try the force reinstall of numpy but it didn’t work so I’m going to try your suggestion of creating new environment
  • I’ve setup docker (using Docker Desktop) once before for a class; I’m not super familiar but I can review class notes and hopefully figure it out … I would be curious about your quick Docker solution, thx

Update: I setup a new Anaconda environment and was able to pip install everything! It’s working! Thank you so much for suggestion. Also I used “conda install -c main ffmpeg” to get ffmpeg working as well without downloading ffmpeg.exe file.

I’d still be interested in your docker suggestion for future apps. Thx

1 Like

See my pull request on github.

1 Like