For JMP 17 and earlier, I have a non Anaconda version(8.6) of Python installed. I successfully ran your sample code without error. I did remove the "Use Python Version" since JMP finds it by default.
The integration of JMP with Python has been an ongoing issue, culminating with JMP 18 installing a version of Python with it. If you can update to JMP 18 as Jarmo suggests is the best solution. If you can not update, then I suggest you search the Discussion responses for possible solutions. I suspect that Python version 12 may be an issue. If you don't absolutely need version 12, I suggest you try deleting it, and installing a non Anaconda version of an older version of Python.
Jim