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

来自:互联网
时间:2021-02-18
阅读:

问题:

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

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

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

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

具体方法为:

1、打开anaconda,单击环境

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

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

pip install torch

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

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple torch
返回顶部
顶部