type
status
date
Jan 30, 2024 09:25 AM
slug
summary
tags
category
icon
password
引言:
遇到的问题-如何安装jupyter lab问题现象说明解决过程总结遇到的问题-snippet无法正常安装使用问题现象说明解决过程总结遗留问题&思考UPDATE # 2024-02-09T02:42:57+0800注意 坑点 1 Permission denied: '/usr/etc/jupyter/jupyter_server_config.d/elyra.json’ 坑点 2 运行报如下错误JupyterLab application assets not found in "/home/jupyterlab/.local/share/jupyter/lab” 坑点 3. 存 snippet 时 `string index out of range`4. code snippet 操作说明Exporting code snippetsImporting code snippetsupdate # 2024-02-14T16:24:52+0800 在 luxury 上部署问题.参考:
遇到的问题-如何安装jupyter lab
问题现象说明
配置过程官网找不到
解决过程
总结
jupyter lab --generate-config
会在用户目录
~/.jupyter/
下生成文件jupyter_lab_config.py
,对其进行修改,涉及以下部分:遇到的问题-snippet无法正常安装使用
问题现象说明
无法保存,或者无法写code部分。
解决过程
换老版本的
jupyter lab
我查了一下,jupyter lab==4 版本异常, version3 正常, 最新的version3 版本如下:
pip install --user jupyterlab==3.6.7
总结
遗留问题&思考
win server 上面的jupyter lab 也可以通过同样方式解决吧?
似乎不对, 后面升级到 3.6.7 试试。
UPDATE # 2024-02-09T02:42:57+0800
发现还有 bug: 无法保存.
最终发现作者弃坑了
注意 坑点 1 Permission denied: '/usr/etc/jupyter/jupyter_server_config.d/elyra.json’
要用 root 执行如下命令 或者指定安装时 —user 安装到用户路径下.
/usr/etc # chmod -R 777 jupyter
否则,运行
jupyter server extension enable elyra
时报错:Permission denied: '/usr/etc/jupyter/jupyter_server_config.d/elyra.json’
坑点 2 运行报如下错误JupyterLab application assets not found in "/home/jupyterlab/.local/share/jupyter/lab”
解决方案, 一般是抄模版, 这个路径里面用户名不对应导致.
在
jupyter_lab_config.py
把/home/jupyterlab/.local/share/jupyter/lab
配置到c.LabApp.app_dir
即可.Here is permanently fixing solution. Runjupyter lab --generate-config
. Then config file is created with printing location of the file(eg.Writing default config to: /Users/blabla/.jupyter/jupyter_lab_config.py
). Open the config file and modify content intoc.LabApp.app_dir = '/opt/homebrew/share/jupyter/lab'
. That's all. @LukaBradeško
坑点 3. 存 snippet 时 `string index out of range`
display name 首字母一定是罗马字符, 不能是中文
4. code snippet 操作说明
Exporting code snippets
To export code snippets:
$ elyra-metadata export code-snippets
\
--directory "/tmp/foo"
The above example will export all code snippets to the “/tmp/foo/code-snippets” directory.
Note that you must specify the
--directory
option.There are two flags that can be specified when exporting code snippets:
- To include invalid code snippets, use the
-include-invalid
flag.
- To clean out the export directory, use the
-clean
flag. Using the-clean
flag in the above example will empty the “/tmp/foo/code-snippets” directory before exporting the code snippets.
Importing code snippets
To import code snippets:
$ elyra-metadata import code-snippets
\
--directory "/tmp/foo"
The above example will import all valid code snippets in the “/tmp/foo” directory (files present in any sub-directories will be ignored).
Note that you must specify the
--directory
option.By default, metadata will not be imported if a code snippet instance with the same name already exists. The
--overwrite
flag can be used to override this default behavior and to replace any installed metadata with the newer file in the import directory.Deleting a code snippet
update # 2024-02-14T16:24:52+0800 在 luxury 上部署问题.
docker-compose.yml
因为 docker 里面 user
jovyan:users
用 id 看是`1000:100`
但本地这里要么是 root, 要么是
1000:1000
的 id.执行此 docker 要看代码里面注释设定权限.
Jupyter docker 权限讲解:
参考:
介绍了 jupyter lab 官方的 docker 地址, 之间关系.
介绍 jupyterhub 的配置
elyra 介绍