Jupyter doesn't recognize torchaudio

I am trying to install torchaudio to use in a Jupyter notebook but when i import it i get the error:

ModuleNotFoundError: No module named 'torchaudio' 

I tried to import it in a .py file that the notebook uses but to with no success. I thought maybe it wasnt installed properly but when i try to install it using pip install torchaudio i get "requirement already satisfied".

Im lost, how can i import it successfully?

6

2 Answers

pip install torchaudio 

should return:

Collecting torchaudio Downloading (6.7MB) |████████████████████████████████| 6.7MB 2.4MB/s Requirement already satisfied: torch==1.6.0 in /usr/local/lib/python3.6/dist-packages (from torchaudio) (1.6.0+cu101) Requirement already satisfied: future in /usr/local/lib/python3.6/dist-packages (from torch==1.6.0->torchaudio) (0.16.0) Requirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (from torch==1.6.0->torchaudio) (1.18.5) Installing collected packages: torchaudio Successfully installed torchaudio-0.6.0 

And everything should work as expected.

Check if you have jupyter installed on your virual environment (where torchaudio is installed). If you do not have, it is likely that you're launching jupyter from your root env and therefore, jupyter is using your root env (which do not have torchaudio installed)

This is a very common mistake. You can solve by pip installing jupyter in the env that torchaudio is installed and launching jupyter from there.

You can always check which jupyter you're launching by running the command:

which jupyter 

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like