6

我正在尝试使用 conda 安装 spyder-kernels 并按照此处的说明在远程服务器上实例化内核:https ://docs.spyder-ide.org/ipythonconsole.html

当我运行命令时python -m spyder_kernels.console出现错误:

/home/selah/anaconda3/bin/python: Error while finding module specification for 'spyder-kernels.console' (ModuleNotFoundError: No module named 'spyder-kernels')

但是,我知道今天早些时候这个命令运行良好。

关于发生了什么以及如何解决它的任何想法?

版本信息:

[selah@lothal ~]$ conda --version
conda 4.6.2
[selah@lothal ~]$ conda list | grep spyder-kernels
spyder-kernels            0.3.0                    py36_0  
[selah@lothal ~]$ find -name '*spyder-kernels*'
./anaconda3/pkgs/spyder-kernels-0.3.0-py36_0
./anaconda3/pkgs/spyder-kernels-0.3.0-py36_0.tar.bz2
./anaconda3/conda-meta/spyder-kernels-0.3.0-py36_0.json
4

1 回答 1

2

鉴于您的评论:

"However, I know that earlier today this command worked fine."

您可能设置了一个已停用的 conda 虚拟环境。试试这个来查看所有可用的conda环境:

conda env list

如果有的话,你可以这样做:

conda list -n whicheverenvyouchoose

查看给定的是否已spyder_kernels安装。

如果您找到它,只需执行以下操作:

conda activate whicheverenvyouchoose

如果您不知何故没有,首先,使用以下内容为您的工作创建一个 conda 虚拟环境:

conda create -n whateveryoudcalltheenv python=x.y anaconda

x.y您首选的 python 版本在哪里。

然后做:

.  activate whateveryoudcalltheenv

现在,继续通过以下方式安装您的软件包:

conda install -n whateveryoudcalltheenv stuff

在这一点上,你应该很高兴。

当您在该环境中完成工作后,只需:

source deactivate

无需命名。

于 2019-02-10T02:02:03.460 回答