Message Boards Message Boards

0
|
5303 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

Installing WolframEngine on WSL: shell won't run

Posted 2 years ago

Hello,

I'm currently trying to install WolframEngine to Ubuntu 20.04.2 LTS which is Linux Subsystem on my Windows computer. This is a ultimately to be able to use wolframscript from within my WSL command line. I've downloaded the WolframScript from here, and installed it with no problems. However, when I try to test it, (e.g. running wolframscript -code 2+2) I'm prompted with this output:

A WolframKernel location could not be determined.

Use -configure to set WOLFRAMSCRIPT_KERNELPATH.
Alternatively, export WolframKernel=/yourpath/WolframKernel.

If you have no Wolfram product currently installed,
 the free Wolfram Engine for developers can be downloaded
 at https://www.wolfram.com/engine/.

I do in fact have a licensed kernal for Wolfram on my computer but since that runs off of Windows, I thought I would install the WolframEngine to my WSL. So I followed the link in the output prompt and downloaded the shell script titled: WolframEngine_12.3.1_LINUX.sh. I've tried running this script (from multiple locations in my system) but each time I run source WolframEngine_12.3.1_LINUX.sh. I always get the output

bash: source: WolframEngine_12.3.1_LINUX.sh: cannot execute binary file

I'm not sure why my system can't run the shell script. I'm running it using bash, as that is the shell interpreter for my Ubuntu distro. How can I get my system to run this file so I can start using wolframscript from my command line?

POSTED BY: David Gillcrist
3 Replies
Posted 2 years ago

I am another Ubuntu 20.04 user and a recent entrant to Wolfram (free Developer Licence) so we can compare notes. I have Windows 10 and Ubuntu 20.04 in dual boot mode (Ubuntu on external bootable SSD).

You write ..

I thought I would install the WolframEngine to my WSL

Clarification is needed. There is WSL1 (the bash only version) and WSL2 (a full instance of Ubuntu only in Windows 11). My Windows 10 does offer WSL1 (bash only) but I have not progressed to trying WSL2 (new generation for coming Windows 11). I do prefer to keep these two beasts apart (Windows and Ubuntu).

You write ..

I'm not sure why my system can't run the shell script. I'm running it using bash, as that is the shell interpreter for my Ubuntu distro. How can I get my system to run this file so I can start using wolframscript from my command line?

Now in my Ubuntu session ...

sudo locate WolframEngine

/usr/local/Wolfram/WolframEngine/12.3/ .. multiple files


sudo locate WolframEngine | grep /home


/home/dl/.WolframEngine/ .. multiple files
/home/dl/Downloads/WolframEngine_12.3.1_LINUX.sh


which wolframscript

/usr/bin/wolframscript

If you run ..

wolframscript --help

you will see ..

 -configure [KEY=VAL...]    Configure WolframScript by specifying values for  particular configuration variable keys. If no keys are given, this prints the current  configuration.

 -activate [KEY]            Activate the Wolfram Engine through the cloud or  with a key.

I recollect that I had to use wolframscript -activate [KEY] to get WolframEngine humming.

Regarding the bash script not running you might just have a permissions problem depending on where you placed the bash script. You can enable the file .. Properties > Permissions > Is executable (tick). I use Krusader file manager for such operations but you can use Nautilus or command line. However if you are in bash mode only (WSL1) you cannot use apps and you will need command line to change permissions.

Finally if you decide to experiment with Jupyter Notebooks integrated with Wolfram you can install a Wolfram Kernel into a Jupyter Notebook.

You will need to install (optionally) WolframLanguageForJupyter.

Here is a full list of Kernels.

https://github.com/jupyter/jupyter/wiki/Jupyter-kernels

Near the bottom is Wolfram Language for Jupyter

https://github.com/WolframResearch/WolframLanguageForJupyter

There is another Kernel named iWolfram which I have not tried.

And since Jupyter Notebooks allows different Kernels to ne used in a Jupyter Notebook you can experiment further with others depending on your requirements.

I am trying a mix of Kernels.

One last point, if you are in Ubuntu you can use editors which recognise the Wolfram Language.

I have as one editor Sublime Text 3 and you can install as a package WolframLanguage.

https://packagecontrol.io/search/wolfram

Here is Visual Studio Code

https://marketplace.visualstudio.com/items?itemName=lsp-wl.lsp-wl-client

Then there is Atom (but now falling behind VSCode since Microsoft acquired Atom).

https://atom.io/packages/language-mathematica

This latter page points to Wolfram Syntax which is helpful.

https://reference.wolfram.com/language/tutorial/InputSyntax.html

I try all three editors in various experiments/learning. I am experimenting with automated workflows to link Wolfram with other apps.

POSTED BY: David Law

Can you be more specific? As far as I am aware, I have at least downloaded the Linux version of WolframEngine. I as for installing it, I assume that is what running WolframEngine_12.3.1_LINUX.sh is meant to do. If this is not the case, how do I go about installing the WolframEngine on Linux?

POSTED BY: David Gillcrist
Posted 2 years ago

You will have to install the Linux version of the Wolfram Engine on the Linux subsystem and use it from wolframscript.

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract