Wally
Wally

Reputation: 1

unable to load torchaudio even after installing

enter image description here

I'm trying to use torchaudio but I'm unable to import it. I have installed it and it is also visible through the pip list.

<ipython-input-6-4cf0a64f61c0> in <module>
----> 1 import torchaudio

ModuleNotFoundError: No module named 'torchaudio'

pytorch-lightning        1.2.0
torch                    1.10.1
torchaudio               0.10.1
torchvision              0.11.2
WARNING: You are using pip version 21.1.2; however, version 21.3.1 is available.
You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.

Upvotes: 0

Views: 3988

Answers (2)

liketaurus
liketaurus

Reputation: 162

I was stuck with the same error. Tried a lot of ways to install and use torchaudio.

This was worked for me (after uninstalling existing torchaudio):

import os
!git clone https://github.com/pytorch/audio.git
os.chdir("audio")
!git checkout 632ea67
!python setup.py install

Upvotes: 0

Lucas Meier
Lucas Meier

Reputation: 449

Since you are using linux and CPU, you should consider uninstalling every pytorch related packages and re-install them via:

pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu

as shown here.

Upvotes: 1

Related Questions