Problem installing Julia plugin in TeXmacs (Windows)

And if that doesn’t work, could you open a Scheme session, enter

(url-exists-in-path? "julia")

and tell us what output you get? It may be that the plugin needs some more information to find the Julia executable (perhaps a :winpath option is needed in init-julia.scm)

I think the problem is that the executable is not found. I do not know what to implement on the scheme side. We need some help from somebody with a Windows machine to find out what is the proper call to make.

From what I can find on the net, it seems like Julia should be installed under

C:\Users\NAME\AppData\Local\Julia-X.X.X\bin\julia.exe 

Looking at what other plugins do, adding

(:winpath "Julia*" "bin")

to plugin-configure in init-julia.scm might work (perhaps :slight_smile: ).

I did it, but same,TeXmacs doesn’t recognize it. And when I run (url-exists-in-path? "julia") in Scheme, it return #f.
On other hand, I have Julia language installed in my pc.

Could you please try to open the file plugins/julia/progs/init-julia.scm in your TeXmacs folder with a text editor and add a line after (plugin-configure julia to make it look like this?

(plugin-configure julia
 (:winpath "Julia*" "bin")
 (:require (url-exists-in-path? "julia"))
 (:serializer ,julia-serialize)
 (:launch ,(julia-launcher))
 (:tab-completion #t)
 (:session "Julia"))

The second line, (:winpath "Julia*" "bin") should be added.

Ok, I just did. But it´s not recognizes by TeXmacs, still.

Could you please retry the (url-exists-in-path? "julia") command?

There may be another issue with the julia-entry function, since it uses slashes / and not backslashes as you would on Windows. It would be good to know if the path issue is already sorted now.

I run again the comand (url-exists-in-path? "julia") but it returned #f.

What is the return value of

(supports-julia?)

Maybe one has to update the plugin list: Tools->Update->Plugins

I updated the plugin list and then run (supports-julia?) and it returned Unbound variable: supports-julia?.

What is the output of

(getenv "PATH")

in a scheme session?

It return this

And what about (getenv "HOME")?

It return "C:\\Users\\mille".

Hi,
You can also have : C:\Users\NAME\AppData\Local\Programs\Julia-X.X.X\bin\julia.exe

@pireddag can you help us with this? I’ve checked the source code for plugins initialisation and it seems to be able to setup the right directories and to look for “.exe” files on Windows. I do not understand why it doesn’t.

@MillerSilva does the Python plugin works for you?

It does not work for me too. In my case

(url-exists-in-path? "julia")
#t
(supports-julia?)
#f

In my PATH I have C:\Users\Giovanni\AppData\Local\Programs\Julia-1.6.1\bin in the user part.

Edit:

It works if the folder is put in TEXMACS_PATH\plugins, it does not work in TEXMACS_HOME_PATH\plugins

Edit 2:

Perhaps the reason why it does not work for @MillerSilva is that he does not have the necessary entry in PATH??

Edit 3:
It works on the TEXMACS_HOME_PATH\plugins too. In this case one needs to update the plugins twice (“Tools->Update->Plugins”) (TeXmacs finds new plugins up to the fourth or fifth “Update”)

The relevant functions are in progs/kernel/texmacs/tm-plugins.scm:

(define (add-to-path u after?)
  (add-to-check-dir-table u)
  (let* ((u1 (url-complete u "dr"))
         (u2 "$PATH")
         (u3 (if after? (url-or u2 u1) (url-or u1 u2)))
         (p  (url-expand u3)))
    (when (not (url-none? u1))
      (setenv "PATH" (url->system p)))))

(define (add-to-path* prefix u after?)
  (add-to-path (url-append (system->url prefix) u) after?))

(define (add-windows-program-path u after?)
  (add-to-path* "C:\\." u after?)
  (add-to-path* "C:\\Program File*" u after?)
  (add-to-path* "$HOME\\AppData\\Local" u after?)
  (add-to-path* "$HOME\\AppData\\Local\\Programs" u after?))

Called by the :winpath declaration in the plugin. It seems it is also adding the path relative to the home directory of the user. Can you check what does it gives that:

(define u (url-append (system->url "$HOME\\AppData\\Local\\Programs" ) (url-append "Julia*" "bin") ))
(url-complete u "dr")
1 Like

Yes, it works. Before I install TeXmacs, I had Python in my pc, installed from the page oficial of Python. But TeXmacs didn’t recognize it, then I installed Python from Windows Store, and this Python itself was recognized by TeXmacs

<url C:\Users\Giovanni\AppData\Local\Programs\Julia-1.6.1\bin>

I do not understand why it works if it is in the TEXMACS_PATH\plugins path and it does not work in TEXMACS_HOME_PATH\plugins

Edit: so the path for @MillerSilva should be found automatically by TeXmacs?
And @MillerSilva: is your plugin in a directory named julia or tm-julia? It could also be the reason why it does not work for you.

What I would try

  1. Check that the plugin is in TEXMACS_PATH\plugins, not in TEXMACS_HOME_PATH\plugins
    (even if TEXMACS_HOME_PATH\plugins is the directory where it should be, but we will work on that last) — After more trying, it can be in TEXMACS_HOME_PATH\plugins, one needs to update the plugins with “Tools->Update->Plugins” twice (I wrote the same in my message above)
  2. Check that the plugin is in a folder named julia, rename the folder if it is not so (e.g. if it is called tm-julia
  3. Check that your Julia is C:\Users\NAME\AppData\Local\Programs\Julia-X.X.X\bin\julia.exe (if not, maybe you will have to add the Julia directory to your PATH)