Windows: ipykernel install prefix not usable for c:\programdata\jupyter

未关闭
#1,234 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
jupyter, python
领域
cli, tooling

调研方向

使用 jupyter --pathspython -m ipykernel install --name pytorch --prefix=C:\\ProgramData\\jupyter 重现该行为;然后检查安装前缀代码,以及假定前缀布局的现有测试。完成的标准是:使用此 Windows 前缀安装的 kernelspec 被放置在 C:\\ProgramData\\jupyter\\kernels 中,并且能从该位置被发现。

由索引模型根据 Issue 内容生成。

描述

On windows jupyter --paths gives

jupyter --paths
config:
    C:\tools\miniconda3\envs\pytorch\etc\jupyter
    C:\Users\Administrator\.jupyter
    C:\Users\Administrator\AppData\Roaming\Python\etc\jupyter
    C:\ProgramData\jupyter
data:
    C:\tools\miniconda3\envs\pytorch\share\jupyter
    C:\Users\Administrator\AppData\Roaming\jupyter
    C:\Users\Administrator\AppData\Roaming\Python\share\jupyter
    C:\ProgramData\jupyter
runtime:
    C:\Users\Administrator\AppData\Roaming\jupyter\runtime

And I'd like to use C:\ProgramData\jupyter to store kernelspecs from various different kernels from different envs (using miniconda at the moment)

Trying to do that...

(pytorch) PS C:\Users\Administrator> python -m ipykernel install --name pytorch --prefix=C:\ProgramData\jupyter
0.03s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
[InstallIPythonKernelSpecApp] WARNING | Installing to C:\ProgramData\jupyter\share\jupyter\kernels, which is not in ['C:\\tools\\miniconda3\\envs\\pytorch\\share\\jupyter\\kernels', 'C:\\Users\\Administrator\\AppData\\Roaming\\jupyter\\kernels', 'C:\\Users\\Administrator\\AppData\\Roaming\\Python\\share\\jupyter\\kernels', 'C:\\ProgramData\\jupyter\\kernels', 'C:\\Users\\Administrator\\.ipython\\kernels']. The kernelspec may not be found.
Installed kernelspec pytorch in C:\ProgramData\jupyter\share\jupyter\kernels\pytorch

so somewhere (took a quick look at the code could only find a test that seemed to assume it would) "share" and "jupyter" added into prefix path before "kernels" so this kernel is not found.

moving C:\ProgramData\jupyter\share\jupyter\kernels\pytorch to C:\ProgramData\jupyter\kernels\pytorch means it gets found

perhaps a --raw-prefix, to which I'd pass C:\ProgramData\jupyter\kernels\ to, that left the prefix as given would solve this?

主要语言
Python
星标
734
派生
411
平均合并
1 天 2 小时
30 天内合并 PR
9

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ipython/ipykernel 的其他 Issue

查看 ipython/ipykernel 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。