windows之anaconda导入torch失败和pip install命令执行read time out

昨天用jupyter导入torch还好好的呢,今天用就不行了,先是ImportError: DLL load failed: 找不到指定的模块。再是No such comm target registered: jupyter.widget.version,最后是下图

然后百度呀,百度的不准可能,每个人还不一样。

最后试过之后,也么找到原因,就是更新了pip(刚开始更新时read time out),把numpy重装了,然后就行了

Read time out

  博主 https://www.cnblogs.com/cchenyang/p/11566472.html 提供了三个法,我最赞成第一个,但是也太慢了吧(我网不好可能) ;第二个个人嫌麻烦,没试。第三个也可以试,我和同学一起买了蓝灯,但我没试。

  我同意上述博主第二个,但是不是永久设置成清华源,而是安装时带上,即命令

python -m pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple
pip uninstall numpy
pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple

 这样就可以解决Read time out问题了,重新安装了numpy就可以用torch了

原文地址:https://www.cnblogs.com/JadenFK3326/p/12162732.html