简体   繁体   中英

unable to load torchaudio even after installing

在此处输入图像描述

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.

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 .

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM