I have code which uses ExternalEvaluate. Specifically the format using "Command" and "Arguments" where the arguments automatically get converted to python input.

ExternalEvaluate[pythonSession1,<| "Command" -> "pythonCommand", 
                    "Arguments" -> {arg}|> ]

I now need to run this code on a cluster where only version 11.1 is available. Is there any work around to add a custom externalEvaluate that mimics the behavior of ExternalEvaluate.

  • $\begingroup$ I think you will need to do something like this $\endgroup$
    – Jason B.
    Jun 28 at 15:50
  • $\begingroup$ I think that just runs a predetermined string in python. I might have to resort to something like this (at that point I think I prefer to just call python from the command line). So it skips the most useful and probably the hardest part of passing the Mathematica arguments to a python function. I would love it if someone knows a way to handle that automatically like ExternalEvaluate does. $\endgroup$
    – Kvothe
    Jun 28 at 16:10
  • $\begingroup$ For that matter. I have seen that some people manage to extract Mathematica definitions. Is there any hope of reconstructing ExternalEvaluate by extracting its definitions from a future version and doing a sort of "Future Import"? $\endgroup$
    – Kvothe
    Jun 28 at 16:11
  • $\begingroup$ I tried whether I could follow the build in definitions to an argument converting function using mathematica.stackexchange.com/a/78898/45020, I think that the thread leading to ExternalEvaluate`Private`normalizeMessage is the relevant one but I got lost there without finding out how the argument conversion works. $\endgroup$
    – Kvothe
    Jun 28 at 21:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.