Sage and python subprocess

42 views
Skip to first unread message

Paul Royik

unread,
Sep 19, 2015, 9:27:39 AM9/19/15
to sage-support
Just installed sage-6.8

From python program I run the following command:

    res = check_output(["/opt/mathenv/sage-6.8/sage","/opt/mathenv/mathsite/mathsite/scripts/eq_solver.sage","x-5", "x",'-oo', '1', 'oo', '1', '14'])

But this piece of code gives me the following error: 

    CalledProcessError: Command '['/opt/mathenv/sage-6.8/sage', '/opt/mathenv/mathsite/mathsite/scripts/eq_solver.sage', 'x-5', 'x', '-oo', '1', 'oo', '1', '14']' returned non-zero exit status 1

It works perfectly if I enter the command directly in shell, so there are no errors with the script.
Moreover if I modify script, so that it doesn't contain sage code (pure python) and run check_output(["python","/opt/mathenv/mathsite/mathsite/scripts/eq_solver.sage","x-5", "x",'-oo', '1', 'oo', '1', '14']), then it works.
That's why I think that the problem is with /opt/mathenv/sage-6.8/sage. Maybe it is virtual environment or something else?

The only difference is that I upgraded from 6.5 to 6.8.

Can somebody advise me what to do or where to find 6.5 distribution?

Paul Royik

unread,
Sep 19, 2015, 11:07:38 AM9/19/15
to sage-support
UPDATE:

I've managed to get the error:


Setting permissions of DOT_SAGE directory so only you can read and write it.
os.chmod(DOT_SAGE, _desired_mode)\nOSError: [Errno 1]
 Operation not permitted: \'/var/www/.sage/

How can I fix it?

Reply all
Reply to author
Forward
0 new messages