all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* MacOS 10.15 cannot use the python-matlab engine.
@ 2021-06-05 13:26 Uwe Brauer
  2021-06-07 15:36 ` [native mac python3 does not work] (was: MacOS 10.15 cannot use the python-matlab engine.) Uwe Brauer
  0 siblings, 1 reply; 2+ messages in thread
From: Uwe Brauer @ 2021-06-05 13:26 UTC (permalink / raw)
  To: emacs-orgmode



Hi 

Could use perfectly well the python-matlab engine from within emacs org
mode in Ubuntu 16.04, python 3.5 and matlab 2019b.

Now I am using 

    1. Macos 10.15 (catalina),

    2. Matlab2019b. (That only support python 2.7, 3.6, 3.7 but not 3.8,
       which the MacOs ships.

    3. So I installed fink (and python 3.7.)

    4. The installation of the python engine.

       a. In /Applications/MATLAB_R2019b.app/extern/engines/python I run

       b. sudo /opt/sw/bin/python3.7 setup.py install

       c. The installation seem fine

    5. Setting up emacs: my setting is now slightly different:

#+BEGIN_SRC emacs-lisp
(setq org-confirm-babel-evaluate nil)   ;don't prompt me to confirm everytime I want to evaluate a block
;;; display/update images in the buffer after I evaluate
(add-hook 'org-babel-after-execute-hook 'org-display-inline-images 'append)
    
(add-to-list 'org-src-lang-modes '("matlab" . matlab))
(setq python-shell-interpreter "/opt/sw/bin/python3.7")
;; set default headers for convenience
(setq org-babel-default-header-args:matlab
      '((:results . "output replace")
	(:session . "matlab")
	(:kernel . "matlab")
	(:exports . "code")
	(:cache .   "no")
	(:noweb . "no")
	(:hlines . "no")
	(:tangle . "no")))
(defalias 'org-babel-execute:matlab 'org-babel-execute:ipython)
(defalias 'org-babel-prep-session:matlab 'org-babel-prep-session:ipython)
(defalias 'org-babel-matlab-initiate-session 'org-babel-ipython-initiate-session)
#+END_SRC


Now, I run as an example 

#+begin_src matlab :results output latex :exports results  :eval never-export :wrap latex
x = [1, 2, 3, 4, 5];
fprintf('|%d', x)
#+end_src


But I obtain now the unexpected error

,----
| Debugger entered--Lisp error: (error "There was a fatal error trying to process the requ...")
|   signal(error ("There was a fatal error trying to process the requ..."))
|   error("There was a fatal error trying to process the requ...")
|   ob-ipython--dump-error("Traceback (most recent call last):\n  File \"/Users/...")
|   ob-ipython--execute-request("x = [1, 2, 3, 4, 5];\nfprintf('|%d', x)" "matlab")
|   ob-ipython--execute-sync("x = [1, 2, 3, 4, 5];\nfprintf('|%d', x)" ((:colname-names) (:rowname-names) (:result-params "replace" "output" "latex") (:result-type . output) (:results . "replace output latex") (:exports . "results") (:session . "matlab") (:kernel . "matlab") (:cache . "no") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:eval . "never-export") (:wrap . "latex")))
|   org-babel-execute:matlab("x = [1, 2, 3, 4, 5];\nfprintf('|%d', x)" ((:colname-names) (:rowname-names) (:result-params "replace" "output" "latex") (:result-type . output) (:results . "replace output latex") (:exports . "results") (:session . "matlab") (:kernel . "matlab") (:cache . "no") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:eval . "never-export") (:wrap . "latex")))
|   org-babel-execute-src-block(nil ("matlab" "x = [1, 2, 3, 4, 5];\nfprintf('|%d', x)" ((:colname-names) (:rowname-names) (:result-params "latex" "output" "replace") (:result-type . output) (:results . "latex output replace") (:exports . "results") (:wrap . "latex") (:eval . "never-export") (:tangle . "no") (:hlines . "no") (:noweb . "no") (:cache . "no") (:kernel . "matlab") (:session . "matlab")) "" nil 2036 "(ref:%s)"))
|   org-ctrl-c-ctrl-c(nil)
|   funcall-interactively(org-ctrl-c-ctrl-c nil)
|   call-interactively(org-ctrl-c-ctrl-c nil nil)
|   command-execute(org-ctrl-c-ctrl-c)
`----


I know that there some MaCOS users here in the list:

Any idea what went wrong.

Any help is strongly appreciated, since I don't have access to my Linux
machine fro the coming days.

Regards

Uwe Brauer 



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

* [native mac python3 does not work] (was: MacOS 10.15 cannot use the python-matlab engine.)
  2021-06-05 13:26 MacOS 10.15 cannot use the python-matlab engine Uwe Brauer
@ 2021-06-07 15:36 ` Uwe Brauer
  0 siblings, 0 replies; 2+ messages in thread
From: Uwe Brauer @ 2021-06-07 15:36 UTC (permalink / raw)
  To: emacs-orgmode

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

>>> "UB" == Uwe Brauer <oub@mat.ucm.es> writes:

> Hi 

> Could use perfectly well the python-matlab engine from within emacs org
> mode in Ubuntu 16.04, python 3.5 and matlab 2019b.

> Now I am using 

>     1. Macos 10.15 (catalina),

>     2. Matlab2019b. (That only support python 2.7, 3.6, 3.7 but not 3.8,
>        which the MacOs ships.

>     3. So I installed fink (and python 3.7.)

>     4. The installation of the python engine.

>        a. In /Applications/MATLAB_R2019b.app/extern/engines/python I run

>        b. sudo /opt/sw/bin/python3.7 setup.py install

>        c. The installation seem fine

>     5. Setting up emacs: my setting is now slightly different:

> #+BEGIN_SRC emacs-lisp
> (setq org-confirm-babel-evaluate nil)   ;don't prompt me to confirm everytime I want to evaluate a block
> ;;; display/update images in the buffer after I evaluate
> (add-hook 'org-babel-after-execute-hook 'org-display-inline-images 'append)
    
> (add-to-list 'org-src-lang-modes '("matlab" . matlab))
> (setq python-shell-interpreter "/opt/sw/bin/python3.7")
> ;; set default headers for convenience
> (setq org-babel-default-header-args:matlab
>       '((:results . "output replace")
> 	(:session . "matlab")
> 	(:kernel . "matlab")
> 	(:exports . "code")
> 	(:cache .   "no")
> 	(:noweb . "no")
> 	(:hlines . "no")
> 	(:tangle . "no")))
> (defalias 'org-babel-execute:matlab 'org-babel-execute:ipython)
> (defalias 'org-babel-prep-session:matlab 'org-babel-prep-session:ipython)
> (defalias 'org-babel-matlab-initiate-session 'org-babel-ipython-initiate-session)
> #+END_SRC



> Now, I run as an example 

> #+begin_src matlab :results output latex :exports results  :eval never-export :wrap latex
> x = [1, 2, 3, 4, 5];
> fprintf('|%d', x)
> #+end_src


> But I obtain now the unexpected error

> ,----
> | Debugger entered--Lisp error: (error "There was a fatal error trying to process the requ...")
> |   signal(error ("There was a fatal error trying to process the requ..."))
> |   error("There was a fatal error trying to process the requ...")
> |   ob-ipython--dump-error("Traceback (most recent call last):\n  File \"/Users/...")
> |   ob-ipython--execute-request("x = [1, 2, 3, 4, 5];\nfprintf('|%d', x)" "matlab")
> |   ob-ipython--execute-sync("x = [1, 2, 3, 4, 5];\nfprintf('|%d', x)"
> | ((:colname-names) (:rowname-names) (:result-params "replace"
> | "output" "latex") (:result-type . output) (:results . "replace
> | output latex") (:exports . "results") (:session . "matlab") (:kernel
> | . "matlab") (:cache . "no") (:noweb . "no") (:hlines . "no")
> | (:tangle . "no") (:eval . "never-export") (:wrap . "latex")))
> |   org-babel-execute:matlab("x = [1, 2, 3, 4, 5];\nfprintf('|%d', x)"
> | ((:colname-names) (:rowname-names) (:result-params "replace"
> | "output" "latex") (:result-type . output) (:results . "replace
> | output latex") (:exports . "results") (:session . "matlab") (:kernel
> | . "matlab") (:cache . "no") (:noweb . "no") (:hlines . "no")
> | (:tangle . "no") (:eval . "never-export") (:wrap . "latex")))
> |   org-babel-execute-src-block(nil ("matlab" "x = [1, 2, 3, 4,
> | 5];\nfprintf('|%d', x)" ((:colname-names) (:rowname-names)
> | (:result-params "latex" "output" "replace") (:result-type . output)
> | (:results . "latex output replace") (:exports . "results") (:wrap .
> | "latex") (:eval . "never-export") (:tangle . "no") (:hlines . "no")
> | (:noweb . "no") (:cache . "no") (:kernel . "matlab") (:session .
> | "matlab")) "" nil 2036 "(ref:%s)"))
> |   org-ctrl-c-ctrl-c(nil)
> |   funcall-interactively(org-ctrl-c-ctrl-c nil)
> |   call-interactively(org-ctrl-c-ctrl-c nil nil)
> |   command-execute(org-ctrl-c-ctrl-c)
> `----


> I know that there some MaCOS users here in the list:

> Any idea what went wrong.

> Any help is strongly appreciated, since I don't have access to my Linux
> machine fro the coming days.

I upgraded my matlab version to 2020b in order to install the engine
with catalina 3.8 engine.

Again the same error.

Help is strongly appreciated.

Uwe Brauer 

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

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

end of thread, other threads:[~2021-06-07 15:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-05 13:26 MacOS 10.15 cannot use the python-matlab engine Uwe Brauer
2021-06-07 15:36 ` [native mac python3 does not work] (was: MacOS 10.15 cannot use the python-matlab engine.) Uwe Brauer

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.