当前位置:主页 > 软件编程 > Python代码 >

详解解决jupyter不能使用pytorch的问题

时间:2021-06-03 09:09:26 | 栏目:Python代码 | 点击:

问题:

昨天在使用jupyter时,发现pytorch又不能用了,之前用了很久的时间安装上,最近一直在用pycharm,转而用jupyter时,发现又开始像之前一样报错,提示:no module named ‘torch'。
尝试各种方法无果。
今天打开anaconda,无意想到,会不会是。。。
我为了美观把pytorch单独配置环境的原因呢?
难道jupyter只继承了base环境?

在这里插入图片描述

立即在base里装了torch,打开jupyter,可以运行了。

在这里插入图片描述

具体方法为:

1、打开anaconda,单击环境

在这里插入图片描述2、

单击base右边的三角,然后打开terminal,输入:

pip install torch

就可以啦!当然如果觉得比较慢,可以用清华源:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple torch

您可能感兴趣的文章:

相关文章