---
title: "§ob-jupyter 조직모드 바벨 파이썬 주피터"
url: "https://notes.junghanacs.com/notes/20240603T174450"
author: "Junghan Kim"
date: "2024-06-03T17:44:00+09:00"
lastmod: "2025-02-17T00:00:00+09:00"
tags: ["bib","jupyter","literate","orgbabel","quarto"]
description: "ob-jupyter와 조직모드 바벨을 이용해 파이썬·주피터 작업을 엮는 흐름을 정리한 노트."
---

> [!abstract] 이 노트에 대하여
> 
> ob-jupyter와 Org Babel을 통해 파이썬과 주피터 환경을 문서 안으로 끌어들이는 방법을 정리한다. 계산 가능한 텍스트와 리터레이트 프로그래밍에 관심이 자연스럽게 이어진다.

## BIBLIOGRAPHY

- “Emacs-Jupyter/Jupyter.” 2025. <https://github.com/emacs-jupyter/jupyter>.

## 관련노트

-   [파이썬 라이브러리를 활용한 데이터 분석 (2023)](https://notes.junghanacs.com/bib/20240524T151227)
-   [젠스 알브레히트 (2022) 파이썬 라이브러리를 활용한 텍스트 분석](https://notes.junghanacs.com/bib/20240604T121824)
-   [울프럼 엔진 무료 - 주피터 노트북 활용 - 이맥스](https://notes.junghanacs.com/notes/20250217T191210)

## 조직모드: 수식: 프리뷰:

## 둠이맥스 emacs-jupyter - ob-jupyter 설정

다음 두 문제만 해결되면 된다.

```text
Error during redisplay: (jit-lock-function 394) signaled (wrong-number-of-arguments ((t) (begin end) (ansi-color-apply-on-region begin end t)) 3)
Quit
C-c ESC ESC ESC is undefined
Error running timer ‘corfu-popupinfo--show’: (void-function company-doc-buffer) [2 times]
```

### emacs-jupyter/jupyter: An interface to communicate with Jupyter kernels.

([“Emacs-Jupyter/Jupyter” 2025](https://notes.junghanacs.com/notes/20240603T174450#citeproc_bib_item_1))

-   [#리터레이트 #프로그래밍 #이맥스 콰르토 주피터](https://notes.junghanacs.com/notes/20240603T174450)

<https://github.com/emacs-jupyter/jupyter>

#### [ZeroMQ - libzmq 비동기 메시지 라이브러리 - 이맥스 주피터 통신::둠이맥스 emacs-jupyter ZMQ module not found - zmq 빌드](https://notes.junghanacs.com/notes/20250218T071249#h-8c3bb215-fd70-4e39-b5a9-fee8d9bd3a6a)

#### [울프럼 플레이어 엔진 설치 활용법 - 메스메티카::울프럼 엔진 리눅스 - 주피터 노트북처럼 사용하는 방법 찾아줘](https://notes.junghanacs.com/notes/20250217T191210#h-7fd8c59d-79bd-43c8-8ee7-9f3f72293885)

여기서도 주피터 설치

### 키바인딩

#### jupyter-repl-interaction-mode-map

```text
jupyter-repl-interaction-mode-map is a variable defined in
jupyter-repl.el.

Value
C-M-x    jupyter-eval-defun
C-c C-b  jupyter-eval-buffer
C-c C-c  jupyter-eval-line-or-region
C-c C-l  jupyter-load-file
C-c C-o  jupyter-eval-remove-overlays
C-c C-r  jupyter-repl-restart-kernel
C-c C-s  jupyter-repl-scratch-buffer
C-c C-z  jupyter-repl-pop-to-buffer
C-c M-:  jupyter-eval-string-command
C-c TAB  jupyter-repl-interrupt-kernel
C-x C-e  jupyter-eval-line-or-region
M-i      jupyter-inspect-at-point
```

#### jupyter-org-interaction-mode-map

```text
jupyter-org-interaction-mode-map is a variable defined in
jupyter-org-client.el.

Value
<jupyter> C-M-x    jupyter-eval-defun
<jupyter> C-c C-r  jupyter-repl-restart-kernel
<jupyter> C-c TAB  jupyter-repl-interrupt-kernel
<jupyter> C-x C-e  jupyter-eval-line-or-region
<jupyter> M-i      jupyter-inspect-at-point
C-c h              jupyter-org-hydra/body
```

### 목표 - 실행 자동완성

다음을 실행하는 것

```python
print("hello")
x = 'foo'
y = 'bar'
x + ' ' + y
```

```text
hello
foo bar
```

jupyter-run-repl 이건 둠이맥스가 좋다

설치 하고 레플 열고

```python
print("hello")
```

```text
hello
```

### 문제 jit-lock-function - ansi-color

### 문제 corfu-popupinfo - company-doc-buffer

### 해결 코드 : my-python-jupyter.el

[2025-02-18 Tue 12:15]

이 파일을 확인

[junghan0611/.doom.d/blob/fd71d03cd8582fa2bb154febbab164655e7f3c09/lis-](https://github.com/junghan0611/.doom.d/blob/fd71d03cd8582fa2bb154febbab164655e7f3c09/lisp/my-python-jupyter.el)

## 파이썬 블록도 모두 `주피터` 연동

[2025-02-19 Wed 22:28]

굳이 해야 되나?

```elisp
;; sqrt-dotfiles-elfeed/.emacs.d/init.el
(with-eval-after-load 'ob-jupyter
  (org-babel-jupyter-override-src-block "python")
  ;; (org-babel-jupyter-override-src-block "hy")
  )
```

된다. 이렇게 되면 다 주피터로 묶는 것. 이게 좋은 점?

```python
print("hello")
x = 'foo'
y = 'bar'
x + ' ' + y
```

## 주피터 노트북 =&gt; 조직모드로 대체 관련 링크

## 콘다 Conda 파이썬 바벨 작업 문서

## [worg/ob-doc-python 파이썬 코드블록 이미지 출력](https://notes.junghanacs.com/notes/20250217T151136) - 파이썬 블록 공식

이 부분이 실제 다루는 방법이 될 것이다.

## 주피터 - 파이썬 - 레플 연동 시나리오 예제

/home/junghan/sync/code/junghan0611/data-science-from-scratch/myscratch/script.org
