I've had some success with the Python integration in the past but after a recent reinstall, I'm having huge problems with getting it to work.
Configuration:
- I'm on JMP Pro 15.2 and Python 3.6.
- Just to make sure the python installation is clean, I've uninstalled it and reinstalled it. No modules other than the needed ones are installed:
- numpy, scipy, pandas, matplotlib, pyqt5 and their dependencies:
>> py -3.6 -m pip freeze
cycler==0.10.0
kiwisolver==1.3.1
matplotlib==3.3.4
numpy==1.19.5
pandas==1.1.5
Pillow==8.2.0
pyparsing==2.4.7
PyQt5==5.15.4
PyQt5-Qt5==5.15.2
PyQt5-sip==12.9.0
python-dateutil==2.8.1
pytz==2021.1
scipy==1.5.4
six==1.16.0
Python Init();
Python Submit( "import sys" );
Python Submit( "print(sys.version)" );
Python Term();
3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)]
0
With this setup I can execute:
Python Init();
x = 5;
Python Send( x );
Python Submit( "print(x)" );
Python Submit(
"\[
basket = ['apple', 'orange', 'pear']
print(basket)
]\"
);
Python Term();
As expected, I see 5.0 in the log and a 0 for Python Term():
5.0
['apple', 'orange', 'pear']
0
Now, if I push anything more than a simple number, string, or list, I get an error:
Python Init();
x = [5];
Python Send( x );
Python Submit( "print(x)" );
Python Term();
This results in the following error:
Python data type is not supported.
Almost none of the Scripting Index examples work. For example:
Names Default To Here( 1 );
Python Init();
a = "abcdef";
d = 3.141;
v = [9 8 7, 6 5 4, 3 2 1];
m = [1 2 3, 4 5 6, 7 8 9];
ml = Python Execute(
{v, m, a, d},
{x, z, a, d},
"\[
import numpy as np
a = np.multiply(v, m) # matrix product
d = np.divide(v, m) # matrix division
z = np.multiply(m, np.linalg.inv(v)) # m * inv(v) called Left division
x = np.multiply(np.linalg.inv(m), v) # inv(m) * v called right division
]\"
);
Show( v, m, ml, x, z, a, d );
Python Term();
Python data type is not supported.
Is there something I'm missing? JMP appears to be finding and sending data to Python just fine so it's not difficulties in finding the Python installation but for some reason, anything that's more than a simple python primitive don't work.
What we see of the real world is not the unvarnished real world but a model of the real world, constructed so it is useful for dealing with the real world. —Richard Dawkins