twibiral / obsidian-execute-code

Obsidian Plugin to execute code in a note.
MIT License
994 stars 61 forks source link

Failure to link Mathematica #327

Open sethshjandemaar opened 6 months ago

sethshjandemaar commented 6 months ago

Good afternoon,

Thanks for making this wonderful little plugin. I am having a lot of fun learning how to use it and make my life in obsidian easier. I am fairly code/tech illiterate. I want to link my Mathematica program to Execute Code as well but I am having an issue with linking the Mathematica path to the plugin settings. From the video you have linked on yall's (the one that this plugin was featured in) I was able to link python. When I do the same with Mathematica I receive the following error message when I attempt to run the code: image

Mathematica is stored locally on my computer and I am attempting to link it to the .exe file. I hope there is not something extremely obvious I am missing. My initial thought is that the folder after the C drive is in fact named 'Program Files' and the code is having a hard time reading the space. When specifying a path is there a character I need to add so it reads the spaces?

Thank you for the help!

twibiral commented 5 months ago

Hi, I guess that comes you are right and the problem is because of the space in "C:/Program Files". Try to use quotation marks around the path like this:

"C:/Progam Files/path/to/..."

Please tell me if it works. We will try to fix this Problem in the code.

sethshjandemaar commented 5 months ago

Good morning,

I attempted your solution and something strange is happening. Whenever I add the quotation marks, "C:/Program Files/Wolfram Research/Mathematica/13.3/Mathematica.exe", and then exit out of the settings window, I get the same error message. I then go back into the settings and the front quotation marks remove themselves, and leave only the trailing ones, ex: C:/Program Files/Wolfram Research/Mathematica/13.3/Mathematica.exe".

I have attempted:

  1. Closing out of settings after inserting the quotes, and re-entering the settings. The front quotes disappear.
  2. Closing out of settings and attempt to run the code block. I get the same error message as stated previously. As I enter back into the settings the front quotes are removed.
  3. Closing out of Obsidian, re-loading, and then check the settings. The front quotes are removed when I check the settings..
  4. Closing out of Obsidian, re-loading, and then run the code. I get the same error message and the front quotes are removed when I check the settings.
  5. I have attempted changing the codeblock to run as run-mathematica as well as mathematica and all issues still occur.

Let me know if you have any other ideas or require any more specified information. I greatly appreciate the help! -Seth

On Thu, 25 Jan 2024 at 03:01, Tim Wibiral @.***> wrote:

Hi, I guess that comes you are right and the problem is because of the space in "C:/Program Files". Try to use quotation marks around the path like this:

"C:/Progam Files/path/to/..."

Please tell me if it works. We will try to fix this Problem in the code.

— Reply to this email directly, view it on GitHub https://github.com/twibiral/obsidian-execute-code/issues/327#issuecomment-1909923534, or unsubscribe https://github.com/notifications/unsubscribe-auth/BEINWH23GCZSU75DCXYWJHDYQI3RDAVCNFSM6AAAAABCJVIN72VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBZHEZDGNJTGQ . You are receiving this because you authored the thread.Message ID: @.***>

bvbunnik commented 4 months ago

Can confirm this "bug" I have the same issue with a path to Rscript. If I try to input "c:\Program Files\R\R-4.1.3\bin\Rscript.exe" it will remove the first quotation mark and change all backslashes in to forward slashes, leaving the last quotation mark upon leaving the settings, i.e.: c:/Program Files/R/R-4.1.3/bin/Rscript.exe"

Some help in this is indeed greatly appreciated!

JeromeGi commented 5 days ago

I run into the same problem and found a workaround (until a proper fix is implemented):