First Experience with Wolfram Engine

Created: by Pradeep Gowda Updated: Dec 10, 2023 Tagged: wolfram

Installation and First run

Found out Wolfram Engine is available for private use and available on homebrew for installation.

On first run of wolframscript, I saw this error:

$ wolframscript

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 put these two lines into a file named file.wls:

#!/usr/bin/env wolframscript
Print[2+2]

I Set the Kernel path, and tried to execute the file - wolframscript file.wls

~ export WolframKernel="/Applications/Wolfram Engine.app/Contents/MacOS/WolframKernel"
➜  ~ wolframscript file.wls

Your Wolfram Engine installation is not activated or is experiencing a license-related problem.

Please run wolframscript with the -activate option, and then try
 your original wolframscript command again.

It appears I had not activated the Wolfram engine. Launching “Wolfram Engine” from the MacOS Spotlight search, i was prompted to enter the worlfram id. I visited https://wolfram.com/engine/free-license to get a license

wolfram engine license agreement page{: width=“500”}

After this I had to enter my worlfran username (my email), and password to activate the license:

first successful run of wolfram{: width=“500”}

Getting back to writing a script:

$ wolframscript file.wls
4

Voila!

This page - https://www.wolfram.com/wolframscript/ is a starting point to learn more about wolframscript.

Interesting:

  • you can pass the -cloud argument to the script to execute the program in wolfram cloud. The wolfram basic account gives you 200 credit. This page service-credits tells you how the credits are used. On the same page, you can also see how much credits cost (eg: 500 credits for $3). Novel (to me) model of charging for “cloud computing”.

See also: Stephen Wolfram