解决Spyder无法正确处理Tensorflow或者pytorch的spyder‑kernels问题
问题核心:python语言的版本不一致,一般3.8及以下没有太大问题
如何解决?出现下面问题怎么办?
The Python environment or installation whose interpreter is located at
F:\py\Anaconda3\envs\sdsd_torch\python.exe
doesn’t have the spyder‑kernels module or the right version of it installed (>= 2.2.1 and < 2.3.0). Without this module is not possible for Spyder to create a console for you.
You can install it by activating your environment (if necessary) and then running in a system terminal:
conda install spyder‑kernels=2.2
or
pip install spyder‑kernels==2.2.*
我以tensorflow为例:
(1)打开Powershell Prompt
conda env list
找到你环境的名字,这里我是tf2.6
(2)激活环境
conda activate tf2.6
(3)最关键的一步
conda install spyder
等于说重装一个以tensorflow的ipykernels作为spyder‑kernels,然后在你的菜单栏出现新的spyder选项,点击打开即可。(如果打开异常可以重启电脑)
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)