In R, system(command = “python3 pythonScript.py”) throws “incompatible architecture” that aren’t present when running the same command directly
I have a python script that runs successfully on multiple computers (an Intel Mac and an M2 Mac) when I run it directly from the Mac Terminal (shell) as /usr/bin/python3 pythonScript.py
, and on the Intel Mac I can also run it from within R, via a base R system()
call (i.e., system(command = "/usr/bin/python3 pythonScript.py")
). But when I try the same system()
call in R on my M2 Mac (that is, not using reticulate or any other R packages to do it), it inappropriately returns incompatible architecture errors, such as below: