1

I would like to use SageMath (using Python) on a AWS EC2 server.

When I tried the SageMath console interface I got the following error:

/opt/sagemath-8.8/local/bin/python: /opt/sagemath-8.8/local/bin/python: cannot execute binary file
/bin/bash: Exit 126.

And with the SageMath shell environment, I got the same error:

(sage-sh) Administrator@EC2AMAZ-P55TVFN:~$ sage
/opt/sagemath-8.8/local/bin/python: /opt/sagemath-8.8/local/bin/python: cannot execute binary file

If useful, here is what $PATH command gives:

(sage-sh) Administrator@EC2AMAZ-P55TVFN:~$ $PATH
bash: /opt/sagemath-8.8/local/lib/R/lib:/opt/sagemath-8.8/local/lib:/opt/sagemath-8.8/build/bin:/opt/sagemath-8.8/src/bin:/opt/sagemath-8.8/local/bin:/usr/local/bin:/usr/bin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Windows/System32/OpenSSH:/cygdrive/c/Program: No such file or directory

How to solve this problem?

  • crossed https://stackoverflow.com/q/58130470/2536808 – Sebastien Palcoux Sep 27 '19 at 15:38
  • Your PATH looks truncated due to the space in "Program Files"? Otherwise, are those paths correct? Can you run python itself interactively? – MisterSmith Sep 27 '19 at 15:55
  • @MisterSmith: the PATH finishes by `/cygdrive/c/Program`. By what should it finish normally? I only installed SageMath on this instance, I don't think I can run Python independantly (otherwise let me know how). – Sebastien Palcoux Sep 27 '19 at 16:28
  • type `python` to start python (type `exit()` inside python to exit if it works). I'm just guessing but `/cygdrive/c/Program` probably doesnt exist? But there will be a folder called "Program Files" inside `/cygdrive/c/`? If so your PATH has been truncated. – MisterSmith Sep 27 '19 at 16:36
  • @MisterSmith: Same problem with python (on this instance): `(sage-sh) Administrator@EC2AMAZ-7G39AK9:~$ python bash: /opt/sagemath-8.8/local/bin/python: cannot execute binary file: Exec format error`. Now, on my laptop where SageMath is working well $PATH finishes similarly, so the problem should not be there. – Sebastien Palcoux Sep 28 '19 at 02:31

0 Answers0