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

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

first successful run of wolfram

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:


See also: Stephen Wolfram