How to run the Wolfram language using Wolfram Client Library for Python in Google colab?
1 Answer
$\begingroup$
$\endgroup$
Herein lies the answer.
Since a short answer is not accepted:
sign in to wolframcloud.com and get the key from there. The process is detailed in the link.
Then on colab:
from wolframclient.evaluation import WolframCloudSession, SecuredAuthenticationKey
from wolframclient.language import wlexpr, wl
key = SecuredAuthenticationKey(
'3274928379750=',
'987345h87598375=')
session = WolframCloudSession(credentials=key)
session.start()
session.authorized()
session.evaluate('1+1')
## this was fun
a = session.evaluate(wlexpr("RandomVariate[NormalDistribution[1,2], 100]"))
import matplotlib.pyplot as plt
plt.hist(a)
Have fun :)