在cmd中用pip安裝好了torch

但是在 pycharm 中 import torch 卻報(bào)錯(cuò)

解決方法:
打開(kāi) pycharm?
打開(kāi)file——settings——Project Interpreter——Show All

選擇System Interpreter
選擇python的安裝目錄D:\Python37\python.exe
選擇好之后確定,pycharm會(huì)執(zhí)行一段時(shí)間
測(cè)試torch是否成功:
新建一個(gè).py的文件,輸入import torch ,若沒(méi)有紅線提示,就安裝好了。