我在用Jupyter和水蟒。在
我的Anaconda3\
和Anaconda3\Scripts\
文件夹已添加到%PATH%
变量中。在
即使jupyter.exe
在上面的Scripts
文件夹中,与Jupyter相关的命令在没有破折号的情况下无法工作。在
例如:
jupyter kernelspec --version
Error executing Jupyter command 'kernelspec': [Errno 'jupyter-kernelspec' not found] 2
使用破折号的同一个命令起作用:
jupyter-kernelspec --version
5.2.2
对jupyter-notebook
等也是如此
我还需要在我的%PATH%
中添加其他内容吗?我错过什么了吗?在
我在Github上也为这一点打开了一个问题,但不幸的是没有引起任何注意:https://github.com/jupyter/jupyter/issues/381
好吧,我知道怎么了。使用},因为缺少{},尽管{}环境变量同时包含{}和{}。在
shutil
模块,在某些Windows版本中which('jupyter-kernelspec')
返回{(这似乎与此有关:shutil.which() not finding programs without appending file extension虽然我不相信,因为
which(jupyter-kernelespec.EXE)
使用shutil
对我来说很好…)因此,我们必须将
.exe
添加到jupyter
的参数中,如下所示:因为大多数Jupyter内核安装程序都使用这种命令,所以您并不总是能够进行调试并检查需要添加到哪里。 解决方法是添加以下内容:
^{pr2}$就在这行之前: https://github.com/jupyter/jupyter_core/blob/f1e18b8a52cd526c0cd1402b6041778dd60f20dc/jupyter_core/command.py#L102
我将尝试向
shutil
模块人员提出这一点。在我也更新了github问题并关闭了它。 https://github.com/jupyter/jupyter/issues/381
相关问题 更多 >
编程相关推荐