This Banner is For Sale !!
Get your ad here for a week in 20$ only and get upto 15k traffic Daily!!!

PyTorch / Jupyter notebook: ModuleNotFoundError: No module named ‘torch’


This publish is a part of the #shortposts sequence the place I publish my learnings in brief šŸ˜‰

Studying is a component and parcel of my journey. I began revisting Linear Algebra to discover the underpinnings of Synthetic Intelligence and Quantum Computing. Linear Algebra is an effective to have for AI and Quantum.

Lately, I picked PyTorch together with NumPy, SciPy, MatplotLib, and different Python libraries. Jupyter pocket book is my go-to software to be taught AI, Information Science and different Python associated matters.



Putting in PyTorch

As a typical learner, I began with the beneath command to put in PyTorch in Jupyter.

!pip set up torch
Enter fullscreen mode

Exit fullscreen mode

Install PyTorch in Jupyter notebook



The error

Within the subsequent cell, once I run

import torch
torch.__version__
Enter fullscreen mode

Exit fullscreen mode

I see an error
ModuleNotFoundError: No module named 'torch'

ModuleNotFoundError: No module named 'torch'



The repair

After some analysis, I discovered that it is a widespread error and I used to be requested to run the pip and python instructions to verify the variations and improve if required and many others., however nothing labored. Till I bumped right into a magic command

%pip set up torch
Enter fullscreen mode

Exit fullscreen mode

You could have to restart your kernel after working this command

Now, once I re-run the PyTorch command

PyTorch up and running

The Article was Inspired from tech community site.
Contact us if this is inspired from your article and we will give you credit for it for serving the community.

This Banner is For Sale !!
Get your ad here for a week in 20$ only and get upto 10k Tech related traffic daily !!!

Leave a Reply

Your email address will not be published. Required fields are marked *

Want to Contribute to us or want to have 15k+ Audience read your Article ? Or Just want to make a strong Backlink?