Pycharm配置导入torch报错Traceback的问题及解决
报错内容
Traceback (most recent call last):
File “”, line 1, in
File “D:\PyCharm Community Edition 2021.2.2\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_import_hook.py”, line 21, in do_import
module = self._system_import(name, *args, **kwargs)
ModuleNotFoundError: No module named ‘torch’
报错截图
图片:

解决办法
File–>Settings

Python Interpreter

点击加号

搜索torch

选择下载install Package

在Python Console中再次导入torch显示True

问题解决
图片:

总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。
相关文章
CentOS6.9 Python环境配置(python2.7、pip、virtualenv)
这篇文章主要介绍了CentOS6.9 Python环境配置(python2.7、pip、virtualenv)方法,非常不错,具有一定的参考借鉴价值 ,需要的朋友可以参考下2019-05-05


最新评论