Problem installing Julia plugin in TeXmacs (Windows)

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)

@pireddag my Julia plugin is in a directory named julia

and whitin of this are the archives (there is another archive named julia)

and whitin of this is

Now, about your advices. I’m sorry, I’m a noob and I don’t know what is the diference between TEXMACS_PATH\plugins and TEXMACS_HOME_PATH\plugins. Or better said, what does mean that?

Anyway I tried this, first I copied the julia directory (plugin) which was in

C:\Program Files (x86)\TeXmacs\plugins

to

C:\Users\mille\AppData\Roaming\TeXmacs\plugins

And finally I opened TeXmacs, updated the plugin list twice, and looked for Julia in Insert->Session and I didn’t find it. :disappointed:

EDIT 1: And my Julia is in C:\Users\mille\AppData\Local\Programs\Julia 1.5.3\bin

Next step IMO would be to see if adding the path to your Julia installation to PATH makes TeXmacs find it (I do not understand how TeXmacs searches for the program, but I am trying to get your setup the same as mine, since mine works). In my setup it is in the user PATH environment variable—I did not see it in the image you posted above.

For those variables

TEXMACS_PATH is the path where you installed TeXmacs (Program Files (x86)\TeXmacs, looking at the image you posted) and TEXMACS_HOME_PATH is the path for the user files (which is C:\Users\mille\AppData\Roaming\TeXmacs in your case)

umm ok, but how can I do that, i.e., how add I the path to my Julia installation to PATH? Please.

Let me link this, which I just found with an Internet search:
https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/
In my case the path to Julia is in the “User variables” section (the upper one)—there is a PATH variable there too.

@pireddag I did what you said me but it didn’t work. Or maybe I did something wrong. I recorded the process, please watch it and tell me what else can I do.

https://www.youtube.com/watch?v=sCBLxE4ubwY

To me it seems right. Probably to figure out what is happening I will need to understand how TeXmacs searches for the program, but it will take time. Maybe @mgubi or @jeroen or @Yibbou have other ideas.

1 Like

I am curious to know what is the value of

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

now that you have modified the path.

:hushed: Now it return #t

Ok, maybe this is a good sign. And (supports-julia?) ?

image

I have the feeling this is good information, but I do not know how to go forward because I do not know how the function supports-julia is assembled by TeXmacs—one of the steps of that does not succeed. I expect the other people participating in the thread to be able to help.

1 Like

This function is not visible outside the init-julia.scm file. You can check on your machine and you get the same error. It is normal. For some reason the plugin is still not correctly initialised. @MillerSilva please remember do to Tools->Update->Plugins to be sure TeXmacs is aware of the new situation.

@darcy can you help you with this issue? I would be nice to understand a solid way to deliver plugins under Windows. Unfortunately right now I do not have a machine ready to try it.

On my machine I get #t for supports-julia? on a Scheme session.

This seems to suggest that the plugin is not found at all. On my system, I get #f for plugins that are installed in TeXmacs, but lack the software to run. E.g., I don’t have PlantUML installed, but for (supports-plantuml?) I get #f, not Unbound variable.

I do not know if my understanding makes sense—I have read the plugin-configure macro and there supports-name is defined with define: is it possible that the whole content of a macro defined with define-public-macro is executed in a “public” way, that is, a way such that a function defined with define will be available globally?

@pireddag : it is actually much simpler, the init-julia.scm file is loaded at top-level and is not a module, therefore any definition is available to the scheme session.

I’ve managed to find a Windows installation and I confirm that the plugin works for me when adding a :winpath declaration as above. So now the problem is why it does not work for @MillerSilva
@MillerSilva please check again your configuration: show us the exact path where the plugin is installed (not a screenshot, but something like:
“C:\Users\mgubi\AppData\Roaming\TeXmacs\plugins\julia”
this is where it is installed on my machine, for example. Moreover show us again where the Julia executable is installed, something like:
“C:\Users\mgubi\AppData\Local\Programs\Julia 1.6.1”
which is where julia is installed on my machine.
Also be sure that the correct file “init-julia.scm” contains the line with :winpath above.
I do not see any reason it should not work.

It might make sense for @MillerSilva to execute the function

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

in a Scheme session, as in this way errors would be reported in the session itself (in Windows they are not sent to the terminal).