解决pytorch明明已经安装好了但是import时报错ModuleNotFoundError: No module named ‘torch‘
问题:
按照b站一些up主的方法来安装,结果运行时却告诉我:报错ModuleNotFoundError: No module named ‘torch‘ 可是我明明已经装了torch
安装教程参考的是(https://www.bilibili.com/video/BV1o3411V7Zz/?spm_id_from=333.880.my_history.page.click&vd_source=ad813e1004be679f01f964a5bda10dd8)
解决:
后来看了一些人的经验,总算没再有这个问题,解决如下:
conda config –add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
conda config –add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
conda config –add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
conda config –add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
conda config –set show_channel_urls yes
`
我用了cpu