emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Exporting tables from python code block: Wrong type argument: markerp, nil
@ 2022-08-02 13:58 Darren Syzling
  2022-08-02 14:32 ` Mark Barton
  0 siblings, 1 reply; 4+ messages in thread
From: Darren Syzling @ 2022-08-02 13:58 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 4090 bytes --]

I'm not sure whether this is an issue with orgmode or my recent Emacs
build, I'm struggling to export orgmode tables from a python code block to
html/pdf.

Version info:
orgmode 9.5.4
GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo
version 1.16.0) of 2022-07-29

Note my Emacs is a custom build with native compilation, json and GTK
support - which may be an issue - i.e. taken straight from the latest code
in github.

My simple test case would be something like:

#+begin_src python :results value raw :exports both
  import pandas as pd
  from tabulate import tabulate
  df = pd.DataFrame({'A': [1, 2], 'B': [3, 4]})
  return tabulate(df, headers=df.columns, tablefmt='orgtbl')
#+end_src

If I execute the code in the editor the org-mode table appears in the
results. If I export to html or pdf I get the
error: org-babel-insert-result: Wrong type argument: markerp, nil.

Even a simple example such as the following fails to export but will show
inline.
#+begin_src python :results table :exports both
   return [['A', 1], ['B', 2]]
#+end_src

Stack trace on failure is below - hence why I was concerned with the custom
Emacs build:
  jit-lock--run-functions(248 324)
  jit-lock-fontify-now(248 #<marker at 324 in test-case.org<2>>)
  org-font-lock-ensure(248 #<marker at 324 in test-case.org<2>>)
  org-table-align()
  org-table-next-field()
  funcall-interactively(org-table-next-field)
  #<subr call-interactively>(org-table-next-field nil nil)
  call-interactively@ido-cr+-record-current-command(#<subr
call-interactively> org-table-next-field nil nil)
  apply(call-interactively@ido-cr+-record-current-command #<subr
call-interactively> (org-table-next-field nil nil))
  call-interactively(org-table-next-field nil nil)
  org-cycle()
  org-babel-insert-result("|    |   A |   B |\n|----+-----+-----|\n|  0 |
1 |..." ("raw" "value" "replace") ("python" "import pandas as pd\nfrom
tabulate import tabulate\n..." ((:colname-names) (:rowname-names)
(:result-params "raw" "value" "replace") (:result-type . value) (:results .
"raw value replace") (:exports . "both") (:cache . "no") (:hlines . "no")
(:noweb . "no") (:session . "none") (:tangle . "no")) "" nil 11 "(ref:%s)")
nil "python")
  org-babel-execute-src-block(nil ("python" "import pandas as pd\nfrom
tabulate import tabulate\n..." ((:colname-names) (:rowname-names)
(:result-params "replace" "value" "raw") (:result-type . value) (:results .
"replace value raw") (:exports . "both") (:tangle . "no") (:session .
"none") (:noweb . "no") (:hlines . "no") (:cache . "no")) "" nil 11
"(ref:%s)"))
  org-babel-exp-results(("python" "import pandas as pd\nfrom tabulate
import tabulate\n..." ((:cache . "no") (:colname-names) (:exports . "both")
(:hlines . "no") (:noweb . "no") (:result-params "replace" "value" "raw")
(:result-type . value) (:results . "replace value raw") (:rowname-names)
(:session . "none") (:tangle . "no")) "" nil 11 "(ref:%s)") block nil
"8ef5c3d71f4f16777939d1b561458e5435a5e4a4")
  org-babel-exp-do-export(("python" "import pandas as pd\nfrom tabulate
import tabulate\n..." ((:cache . "no") (:colname-names) (:exports . "both")
(:hlines . "no") (:noweb . "no") (:result-params "replace" "value" "raw")
(:result-type . value) (:results . "replace value raw") (:rowname-names)
(:session . "none") (:tangle . "no")) "" nil 11 "(ref:%s)") block
"8ef5c3d71f4f16777939d1b561458e5435a5e4a4")
  org-babel-exp-src-block()
  org-babel-exp-process-buffer()
  org-export-as(html nil nil nil (:output-file "test-case.html"))
  org-export-to-file(html "test-case.html" nil nil nil nil nil)
  org-html-export-to-html(nil nil nil nil)
  org-export-dispatch(nil)
  funcall-interactively(org-export-dispatch nil)
  #<subr call-interactively>(org-export-dispatch nil nil)
  call-interactively@ido-cr+-record-current-command(#<subr
call-interactively> org-export-dispatch nil nil)
  apply(call-interactively@ido-cr+-record-current-command #<subr
call-interactively> (org-export-dispatch nil nil))
  call-interactively(org-export-dispatch nil nil)
  command-execute(org-export-dispatch)


 Darren

[-- Attachment #2: Type: text/html, Size: 5293 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Exporting tables from python code block: Wrong type argument: markerp, nil
  2022-08-02 13:58 Exporting tables from python code block: Wrong type argument: markerp, nil Darren Syzling
@ 2022-08-02 14:32 ` Mark Barton
  2022-08-02 21:58   ` Tim Cross
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Barton @ 2022-08-02 14:32 UTC (permalink / raw)
  To: Darren Syzling; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 833 bytes --]



> On Aug 2, 2022, at 6:58 AM, Darren Syzling <dsyzling@gmail.com> wrote:
> 
> If I execute the code in the editor the org-mode table appears in the results. If I export to html or pdf I get the error: org-babel-insert-result: Wrong type argument: markerp, nil.

I also am experiencing this error.
Org mode version 9.5.4 (release_9.5.4-17-g6e991f @ /Applications/Emacs.app/Contents/Resources/lisp/org/)
GNU Emacs 29.0.50 (build 1, x86_64-apple-darwin21.5.0, NS appkit-2113.50 Version 12.4 (Build 21F79)) of 2022-08-01

In order to export the pdf, I evaluated the following to disable having the export execute the src blocks and just manually ran them to have the updated results inserted into the org file.
(setq org-export-use-babel nil)

The last time I exported that document successfully was 2022-05-10. 


Mark

[-- Attachment #2: Type: text/html, Size: 1950 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Exporting tables from python code block: Wrong type argument: markerp, nil
  2022-08-02 14:32 ` Mark Barton
@ 2022-08-02 21:58   ` Tim Cross
  2022-08-03 11:07     ` Darren Syzling
  0 siblings, 1 reply; 4+ messages in thread
From: Tim Cross @ 2022-08-02 21:58 UTC (permalink / raw)
  To: Mark Barton; +Cc: Darren Syzling, emacs-orgmode


Mark Barton <mbarton98@gmail.com> writes:

>  On Aug 2, 2022, at 6:58 AM, Darren Syzling <dsyzling@gmail.com> wrote:
>
>  If I execute the code in the editor the org-mode table appears in the results. If I export to html or pdf I get the error:
>  org-babel-insert-result: Wrong type argument: markerp, nil.
>
> I also am experiencing this error.
> Org mode version 9.5.4 (release_9.5.4-17-g6e991f @ /Applications/Emacs.app/Contents/Resources/lisp/org/)
> GNU Emacs 29.0.50 (build 1, x86_64-apple-darwin21.5.0, NS appkit-2113.50 Version 12.4 (Build 21F79)) of 2022-08-01
>
> In order to export the pdf, I evaluated the following to disable having the export execute the src blocks and just manually
> ran them to have the updated results inserted into the org file.
> (setq org-export-use-babel nil)
>
> The last time I exported that document successfully was 2022-05-10. 
>

Note that a bug was recently found in Emacs 29 relating to byte
compilation which was generating this error. Apparently it also causes
problems with backwards compatibility of *.elc files.

Not sure if it has been fixed in Emacs master yet, but my recommendation
would be to do a git pull for Emacs, followed by a make extraclean,
./autogent.sh, ./configure and make and then a rebuild of any additional
packages you have installed.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Exporting tables from python code block: Wrong type argument: markerp, nil
  2022-08-02 21:58   ` Tim Cross
@ 2022-08-03 11:07     ` Darren Syzling
  0 siblings, 0 replies; 4+ messages in thread
From: Darren Syzling @ 2022-08-03 11:07 UTC (permalink / raw)
  To: Tim Cross; +Cc: Mark Barton, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 650 bytes --]

>
>
> Note that a bug was recently found in Emacs 29 relating to byte
> compilation which was generating this error. Apparently it also causes
> problems with backwards compatibility of *.elc files.
>
> Not sure if it has been fixed in Emacs master yet, but my recommendation
> would be to do a git pull for Emacs, followed by a make extraclean,
> ./autogent.sh, ./configure and make and then a rebuild of any additional
> packages you have installed.
>
>
Tim thanks for confirming that this may be an issue with the latest Emacs
version, I will try what you suggest and also see if I can track down the
related byte compilation bug.

Regards
Darren

[-- Attachment #2: Type: text/html, Size: 939 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-08-03 11:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-02 13:58 Exporting tables from python code block: Wrong type argument: markerp, nil Darren Syzling
2022-08-02 14:32 ` Mark Barton
2022-08-02 21:58   ` Tim Cross
2022-08-03 11:07     ` Darren Syzling

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).