Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Module not found in pycharm (Windows)

I wanted to install Pytorch via anaconda and it worked but PyCharm can't find the module (

ModuleNotFoundError: No module named 'torch'

I also have CUDA installed but when I looked up to add a the package with pycharm it also gives an error. When I added the anaconda interpreter I can't run the code. I use Python 3.6

like image 553
Tinec Avatar asked Mar 05 '23 05:03

Tinec


1 Answers

Ok I solved this problem: First install anaconda and open the prompt then type conda install pytorch -c pytorch and pip3 install torchvision. Then go to PyCharm and create an Project and set the Project Interpreter to the Anaconda one (there is in the path: \Anaconda.x.x\python.exe ). Then you go to the Run settings and click Run... and then you go to Edit Configurations and then you select the Project Default interpreter and apply and you should be done! Thanks to the ppl who helped me =)

like image 141
Tinec Avatar answered Mar 08 '23 23:03

Tinec