Unable to use Macaulay2 interface of sage in .sage file
I am doing some calculations in sage using Macaulay2 interface. While runing the Macaulay2 interface in .sage file, I am getting the following error:
NameError: name 'macaulay2' is not defined
For example, consider the following:
R = macaulay2.ring('QQ', '[x]');
I = macaulay2.ideal(x)
n = macaulay2.res(I)
print(n)
My commands are correct. In fact, these are working in jupyter notebook and in sage terminal.
Can anyone help me in this regard?
Please provide the commands one can run in a fresh Sage session to reproduce the issue.
I have updated the question.
How do you evaluate/load the
.sage
script ? Which command ?The command I give is:
where abc.sage is the file name. I am using SageMath 9.2 on ubuntu 16.04.