我在使用 Jupyter Notebook 时听到并看到了很多“内核”这个词。我只想知道“内核”在 Jupyter Notebook 中代表什么。它与我们在操作系统中使用的含义相同吗?如果它相似/不同,究竟如何?
两个内核都进行硬件交互吗?
内核(操作系统):https ://simple.m.wikipedia.org/wiki/Kernel_( computer_science)
内核(Jupyter Notebook) https://jupyter-client.readthedocs.io/en/stable/kernels.html
我似乎无法从lfortran jupyter kernel获得输出。
我通过 conda install 安装了:
- lfortran
- jupyter
Run Code Online (Sandbox Code Playgroud)
我可以运行jupyter并选择 lfortran 内核。然而:
我没有看到 hello world,也没有看到错误。
如果在第二个单元格中我调用new它会使内核崩溃。
我无法将 Jupyter 内核链接到其父 Conda 环境。创建链接到 Conda 环境的新内核后,我在 Jupyter 实验室中获得了不同版本的 Python 及其依赖项。
\n\n以下是我遵循的步骤:
\n\n使用以下命令创建 conda 环境:
\n\nconda create -n nlp python=3.6
conda activate nlp
(nlp) \xe2\x9e\x9c ~ python --version
\n\n\nPython 3.6.9 :: Anaconda, Inc.
\n
(nlp) \xe2\x9e\x9c ~ which python
\n\n\n/anaconda3/envs/nlp/bin/python
\n
在环境中我创建了一个 Jupyter 内核:
\n\n(nlp) \xe2\x9e\x9c ~ python -m ipykernel install --user --name=nlp
\n\n\n在 /Users//Library/Jupyter/kernels/nlp 中安装 kernelspec nlp
\n
研究为内核创建的 json 文件:
\n\n(nlp) \xe2\x9e\x9c …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用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')
Run Code Online (Sandbox Code Playgroud)
但是,我知道今天早些时候这个命令工作正常.
关于发生了什么以及如何解决它的任何想法?
版本信息:
[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
Run Code Online (Sandbox Code Playgroud) winscp amazon-ec2 amazon-web-services jupyter-notebook jupyter-kernel
jupyter我在kubernetes 集群的命名空间中设置了 Jupyter 笔记本,并enterprise-gateway在同一集群中的命名空间中设置了 Jupyter Enterprise Gateway 作为服务。
如果我将笔记本配置为enterprise-gateway使用 clusterIP 连接到服务,则它可以正常工作。
--gateway-url=http://172.20.186.249:8888
Run Code Online (Sandbox Code Playgroud)
但如果我切换到使用服务域名,笔记本电脑会收到 503 Connection Refused 错误
--gateway-url=http://enterprise-gateway.enterprise-gateway.svc.cluster.local:8888
Run Code Online (Sandbox Code Playgroud)
当我使用 busybox check 检查 kubernetes dns 时,域按预期解析。
kubectl -n default exec -ti busybox nslookup enterprise-gateway.enterprise-gateway
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.
Server: 172.20.0.10
Address 1: 172.20.0.10 kube-dns.kube-system.svc.cluster.local
Name: enterprise-gateway.enterprise-gateway
Address 1: 172.20.186.249 enterprise-gateway.enterprise-gateway.svc.cluster.local
Run Code Online (Sandbox Code Playgroud)
如何让域名发挥作用?
JEG 的服务配置如下所示......
kubectl describe svc enterprise-gateway --namespace enterprise-gateway …Run Code Online (Sandbox Code Playgroud) amazon-ec2 ×1
anaconda ×1
conda ×1
fortran ×1
jupyter ×1
jupyter-lab ×1
kernel ×1
kubernetes ×1
python ×1
spyder ×1
winscp ×1