Insert->session ->R does not start R session in Texmacs 2.1.1 in Windows

Thanks for your quick response.

For Scheme session command,
(url-resolve-in-path “tm_r”)
I got following output,
<url {}>

Moreover, my Taxmacs is installed in this very subdirectory as mentioned by you above, i.e, in C:\Program Files (x86)\TeXmacs\plugins\r\bin\ , wherein one file resides. Its name is “r_install”, which contains some texcsmacs scripts probability, as I knew on opening it in notepad text editor, but did not change or save, simply closed it as such.

With regards,

Dr. A. K. Singh

AFAICT it won’t work without the tm_r executable, which it seems is missing from your installation (as is also mentioned in the other thread @pireddag linked to).

You could try this build of TeXmacs, perhaps it does include the necessary file (I haven’t tried):

Nope, on my side the r plugin has never compiled in Mingw, AFAIR. I think the interprocess communication is relying on some posix stuff that needs to be transformed to a windows equivalent.

Thanks for sending the new link for Texmacs.
From there I downloaded the Texmacs 2.1.2 + file with the name “texmacs_installer.2.1.2.14105M.exe”.
Uninstalled the old one, and installed this one, and carried out the two tests as suggested above on two occasions. The outputs are given below:
Scheme] (supports-r?)

#t

Scheme] (url-resolve-in-path “tm_r”)

Unbound variable: “tm_r”

Scheme]

It may be noted that this time the second output is different. But, still R-session is still giving ‘Busy’ output as follows:

Busy…

R] c(1:100)

Busy…

R]

Moreover, it is should be informed that this time too, the texmacs installed in the above mentioned path only.

In the last, I have a lingering doubt. Since the version 4.2.0, R has stopped releasing 32 Bit application and now only releases 64bit application. At present, I am running R-4.3.0, the current version. And I guess that Texmacs is 32 bit application. So, could it be the reason of R not connecting with Texmacs? Just a guess. However, this time another change of ‘Unbound variable: “tm_r”’ is also comming.

I do not know what is happening. Is there Texmacs 64 bit? Kindly help and bring me to the solution, please.

With regards,

Dr. A.K. Singh

Time to rewrite that plugin in anther language. Python or Scheme, I guess. R is a very popular language, we should be able to support it better.

4 Likes

Hi @akhileshsingh.igkv, from what I can see, and looking also at the whole previous thread Does the R plugin work?, I think the plugin (unfortunately) does not work in Windows.

I think this both @pjoyez said that he does not remember the R plugin to compile; the failed compilation test that I did myself is less significant because I did it by trial and error.

Hopefully someone will pick this up and provide an R plugin! (It is too difficult for my current ability, so I am not proposing that I shall do it).

The Jupyter plugin with an R kernel could be a workaround. (though I haven’t tested it on Windows either)

Yes, I agree. I tested many editors/languages for writing book or articles. Everyone has one or the other shortcoming which forces me to try the other. I thought that my search ends here because it has all the document writing features. But, here too the problem is that R plugin is not up to date. Since I am an Statistician, I can’t do without R codes. Most statisticiand go to R markdown platform because none of developers have integrated R so nicely as Rstuduo. The Markdown language is easy but NOT good for perfect documentation, like that of Texmacs.

But, due to old R plugin I will have to leave Texmacs TEMPORARILY till R plugin is updated for Windows.

I request the developers to take up this matter in priority, so users of my kind may be benefited.

Had this R plugin been updated, I would have taught Texmacs to my students too for their practical work in statistics and their thesis writing too. My students study R. But, without support of R plugin this would NOT be possible.

I hope and shall WAIT till some developer takes up this matter in priority.

Thanks and regards,

Dr. A. K. Singh

2 Likes

Dear, jeroen,
Will you kindly suggest in detail as how can I use jupyter plugin with an R kernel as a workaround. I will test it, because I work on Windows. And I need it. Please suggest step wise.

With regards,
Dr. A. K. Singh

First a disclaimer: this isn’t tested, so you may be spending time for no outcome. Also, I can’t provide step by step instructions, as I am not a Windows user, so you’ll have to do some research of your own.

First step would be to install Jupyter and the IR-kernel.

1 Like

Thanks for reply.
First I installed IRkernel package in R.
Then I installed Jupyter. But, Jupyter didn’t show R kernel inside Jupyter. So, I googled.
Then, I ran IRkernel:::installspec()
Then, Jupyter started showing R kernel inside it.
But, still then, Taxmacs didn’t run R, only showing Busy status in R.

I hope some developer will have to see to it ,to solve the problem for the sake of users of a popular language R.

With regards,

A.K. Singh

The next step is to install the Jupyter plugin to allow TeXmacs to communicate with Jupyter, which in turn calls R.

You need to download the plugin from here, unzip it, then copy the folder tm-jupyter-master to the plugins subfolder of your TeXmacs home path (execute (get-texmacs-home-path) in Scheme to find out where it is).

Finally rename the copied folder from tm-jupyter-master to jupyter and restart TeXmacs. You should now have Jupyter sessions available, hopefully with R. If not, try Tools->Update->Plugins and restart.

1 Like

Thanks jeroen, for taking pains for me. I felt very hopeful with your post. I tried all the steps steadily and carefully. Did all the steps. But, I don’t know why it didn’t work. Meanwhile, I updated to Texmacs 2.1.2 from GitHub. I tried all the steps on it.

I also tried by copying the renamed jupyter folder to plugin path " `C:\Program Files (x86)\TeXmacs\plugins" , even then after update plugin step and restart, it did not show jupyter session.

After all above stei, I also tried the command (supports-jupyter?), which gave the reply “#f”. And, then tried the command (url-resolve-in-path “tm-jupyter”), which gave reply <url {}>.

With regards,

Dr. A.K.Singh

Sorry to hear it didn’t work. It may be because of the use of shebangs to run scripts, which isn’t supported on Windows.

I have been working recently on a complete rewrite of the Jupyter plugin to use a more high-level library. I’ve made a change so that it calls the python command directly, which should give better Windows compatibility.

You can download it here. The same instructions apply. The unzipped folder needs to be renamed jupyter inside the TeXmacs home plugins folder.

Note that this plugin is still missing important features, such as auto-completion and syntax highlighting.

Also note that this plugin will currently only work in the home directory, not in Program Files.

1 Like

Thanks jeroen, I will try it and will tell you itsfeedback.

Meanwhile, I want to give you another feedback. That, except the Scheme session, none of plugins’ sessions in TeXmacs are running, all are giving Busy status like R plugin. This information may likely to lead you to some important clue.

With regards,

Dr. A. K. Singh

Dear Jeroen

At present I am testing it, as per the instructions given, That is, after download, unzipped, renamed the folder to ‘jupyter’ and then copied the entire folder to plugins folder of the home path, i.e. not in the program files path. Then, opened Texmacs, did tools=>update=>plugins. Then restarted Texmacs.

This time jupyter plugin started showing as Insert => Session =>Jupyter=>default as one option and the other option as Insert => Session =>Jupyter=>Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.

I chose both options one by one and in both cases, and the results were still the same, see the copied output below:

Busy…

Jupyter]

Let me inform you that I have both Python 3.11.3 and the latest JuypterLab installed. In the latter, IR kernel is showing and working. But, why I don’t like either Jupyter Notebook, Jupyter Notebook and Rmarkdown, because both follow markdown for wirting text materials, other than the R codes, which is very clumsy, and NOT as per the standards of a good typeset article or book. I liked the same in TeXmacs, but here I am suffering from problems with R plugins.

Still, I hope you would be able to do something real good.

With regards,

Dr. A.K. Singh

Have you tried following this suggestion? IIRC, Windows has some aliases for Python that prevent Python-based plugins from running.

Dear jeroen,

Frankly, I didn’t understand the meaning of this message. If you have understood, then kindly tell me what to do? Is there any settings that I can change to get the solution. Please tell. I will try

With regards,

Dr. A. K. Singh

This message is referring to a setting in the Windows settings menu.

Once you’re in the Windows settings menu, search for alias. There should be one for python.exe, which you should turn off.

Dear http://forum.texmacs.cn/u/jeroen,

Wonderful, your idea and your jupyter plugin both worked. Thank you very much. Its IR option worked for me. I was only having a lingering hope with our conversations, otherwise, had this not been successful, I would have been forced to uninstall TeXmacs for the lack of interactive R-sessons, and would have lost the opportunity of using a good Editor for Statistics and Mathmatics people like TeXmacs.

I wish a very grand good luck for completing the rest of the features for this jupyter plugin, and hope that, please keep sending me the link for fresher version of this plugin.

Also, similarly, I wish, if you do not feel it like a burden, please do make the R plugin also work directly in TeXmacs. I was lucky to get your help. Otherwise, all other users of R may not be that lucky.

Thanks again and regards,

Dr. A.K. Singh

2 Likes