studio-lab-examples icon indicating copy to clipboard operation
studio-lab-examples copied to clipboard

Missing permissions to install C library

Open mizoru opened this issue 3 years ago • 3 comments

I'm trying to set up torchaudio/fastaudio. When I do: import torchaudio I get: OSError: sndfile library not found

However when I ran conda install -c conda-forge librosa, libsndfile conda-forge/linux-64::libsndfile-1.0.31-h9c3ff4c_1 was one of the packages.

When I try apt update and apt-get install libsndfile1-dev, I get

Reading package lists... Done
E: List directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied)

and

E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?

respectively.

mizoru avatar Dec 10 '21 15:12 mizoru

Hi, I was able to install torch, torchaudio, and run through this notebook without issue.

  • https://pytorch.org/audio/stable/tutorials/audio_io_tutorial.html

The key for me was, as always, using the %pip install on both %pip install torch and %pip install torchaudio. After that I restarted my kernel manually using the button on the top.

Then I ran through the rest of this notebook, ultimately successfully running the final command metadata = torchaudio.info(SAMPLE_WAV_PATH). On the final print, I saw the metadata reported as AudioMetaData(sample_rate=44100, num_frames=109368, num_channels=2, bits_per_sample=16, encoding=PCM_S).

Hope this helps.

EmilyWebber avatar Dec 10 '21 16:12 EmilyWebber

Ah, it is fastaudio that requires an older torchaudio version. So to recreate the issue you pip install fastaudio first.

mizoru avatar Dec 10 '21 17:12 mizoru

I see - I was just able to replicate your issue. I'll keep this open so we can triage.

EmilyWebber avatar Dec 10 '21 21:12 EmilyWebber