Closed zeta-00 closed 2 years ago
Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p t) ein:maybe-truncate-string-lines("In [ ]:" t) ein:insert-read-only("In [ ]:" font-lock-face ein:codecell-input-prompt-face)
apply(#f(compiled-function (cell) "Insert prompt of the CELL in the buffer.\n Called from ewoc pretty printer via `ein:cell-pp'." #<bytecode 0x527cf9d9>) #
ein:cell-make-element(#f(compiled-function (&rest path) #<bytecode 0x46a2a7ff>) 0)
apply(#f(compiled-function (cell) #<bytecode 0x527cecf7>) #
apply(#f(compiled-function (ws) #<bytecode 0x527fe68f>) #
ein:content-query-contents--success("http://127.0.0.1:8888" "Untitled3.ipynb" #f(compiled-function (&rest args2) #<bytecode 0x4741ebfd>) :data (:name "Untitled3.ipynb" :path "Untitled3.ipynb" :last_modified "2022-02-10T01:38:29.492501Z" :created "2022-02-10T01:38:29.492501Z" :content (:cells [] :metadata nil :nbformat 4 :nbformat_minor 5) :format "json" :mimetype nil :size 72 :writable t :type "notebook") :symbol-status success :error-thrown nil :response #s(request-response :status-code 200 :history nil :data (:name "Untitled3.ipynb" :path "Untitled3.ipynb" :last_modified "2022-02-10T01:38:29.492501Z" :created "2022-02-10T01:38:29.492501Z" :content (:cells [] :metadata nil :nbformat 4 :nbformat_minor 5) :format "json" :mimetype nil :size 72 :writable t :type "notebook") :error-thrown nil :symbol-status success :url "http://127.0.0.1:8888/api/contents/Untitled3.ipynb" :done-p nil :settings (:type "GET" :parser ein:json-read :complete #f(compiled-function (&rest args2) #<bytecode 0x527bdb1d>) :success #f(compiled-function (&rest args2) #<bytecode 0x527bdb39>) :error #f(compiled-function (&rest args2) #<bytecode 0x527bdb55>) :timeout 10.0 :sync nil :headers (("User-Agent" . "Mozilla/5.0") ("X-XSRFTOKEN" . "2|ac7a28d7|b9730aabf9bc504208d5230279350d55|164445...")) :encoding binary :url "http://127.0.0.1:8888/api/contents/Untitled3.ipynb" :response #11) :-buffer #
apply(#f(compiled-function (&rest args2) #<bytecode 0x527bdb39>) (:data (:name "Untitled3.ipynb" :path "Untitled3.ipynb" :last_modified "2022-02-10T01:38:29.492501Z" :created "2022-02-10T01:38:29.492501Z" :content (:cells [] :metadata nil :nbformat 4 :nbformat_minor 5) :format "json" :mimetype nil :size 72 :writable t :type "notebook") :symbol-status success :error-thrown nil :response #s(request-response :status-code 200 :history nil :data (:name "Untitled3.ipynb" :path "Untitled3.ipynb" :last_modified "2022-02-10T01:38:29.492501Z" :created "2022-02-10T01:38:29.492501Z" :content (:cells [] :metadata nil :nbformat 4 :nbformat_minor 5) :format "json" :mimetype nil :size 72 :writable t :type "notebook") :error-thrown nil :symbol-status success :url "http://127.0.0.1:8888/api/contents/Untitled3.ipynb" :done-p nil :settings (:type "GET" :parser ein:json-read :complete #f(compiled-function (&rest args2) #<bytecode 0x527bdb1d>) :success #f(compiled-function (&rest args2) #<bytecode 0x527bdb39>) :error #f(compiled-function (&rest args2) #<bytecode 0x527bdb55>) :timeout 10.0 :sync nil :headers (("User-Agent" . "Mozilla/5.0") ("X-XSRFTOKEN" . "2|ac7a28d7|b9730aabf9bc504208d5230279350d55|164445...")) :encoding binary :url "http://127.0.0.1:8888/api/contents/Untitled3.ipynb" :response #10) :-buffer #
When I run jupyter-notebook
in a terminal, it opens in a web browser and works just fine, but, for some reason EIN is not working in Emacs.
(use-package eglot :defer t :hook (python-mode . eglot-ensure))
I have a hook to run eglot-mode
whenever python-mode
gets activated for a regular file, but I'm not sure if this is messing things up whenever I open a .ipynb
file with EIN
.
Also, I'm using treemacs
so I'm not sure if that's what is messing up EIN in Emacs.
We never seem to get anywhere #806 #775 #723 #720 #709 #708 #642 #636.
The goal of data analysis is getting results, not fighting with your tools. While I myself have not heeded my own advice, and have dedicated my waking hours to fighting emacs, I do not recommend that poor life choice to others.
Greetings,
I installed the required tools to do Python/Jupyter coding in EIN, but, for some reason, after I run
ein:run
then press[New Notebook]
, these errors get thrown:error in process sentinel: ein:insert-read-only: Wrong type argument: number-or-marker-p, t error in process sentinel: Wrong type argument: number-or-marker-p, t
It's been a while since I used EIN, so I'm not sure if I'm missing something in my .emacs config. I installed all the required Python/Jupyter stuff with the nix package manager so there shouldn't be any issues there.
Anyways, here's my EIN config in my .emacs file:
;;------------------------------------------------- (use-package ein :defer t :hook (ein-mode . elpy-mode) :config (setq ein:auto-save-on-execute t) (setq ein:output-area-inlined-images t) (setq ein:slice-image t) (setq ein:complete-on-dot t) (setq ein:polymode t) (setq ein:use-smartrep t) (setq ein:use-auto-complete t) :custom (ein:completion-backend 'ein:use-company-backend) (ein:truncate-long-cell-output t) (ein:auto-black-on-execute t) ) ;;------------------------------------------------- (use-package python-mode :defer t :hook (python-mode . company-mode) :config ;; emacs calculates line offset: (setq python-indent-guess-indent-offset t) ;; silence warnings while emacs calculates the line offset: (setq python-indent-guess-indent-offset-verbose t)) ;;------------------------------------------------- ;; company-jedi setup: (defun my/python-mode-hook () (add-to-list 'company-backends 'company-jedi))
(add-hook 'python-mode-hook 'my/python-mode-hook) ;;------------------------------------------------- (use-package elpy :defer t :config (elpy-enable) (elpy-company-backend) (elpy-get-info-from-shell) (setq python-shell-interpreter "ipython" python-shell-interpreter-args "-i --simple-prompt")) ;;-------------------------------------------------