First I want to apologize for the trouble you are having with JMP's python support. The original developer of the Python feature retired at the end of JMP 14's development cycle. I am working my way through the code to fix the outstanding issues.
There are issues with JMP's ability to locate Python. If JMP finds it by itself you are good to go, usually if you only have one version of Python on your system you will be fine. When it fails, it is difficult to work around the issue in current JMP releases. Additionally there are differences between Windows and Mac in how well or how poor it is at finding Python. I have uncovered a couple of bugs in the code that is supposed to let you specify where your instance of Python is located.
Use the Python sys path( {"",...} ) within Python Init() works on JMP for Mac v14.1 or newer, but is broken on JMP 14.0, 14.1 for Windows.
Windows JMP does not handle it well if there is more than one version of Python on the system. You need to specify the version of Python to use within the Python Init ( Use Python Version("3.6")); for example to select the 3.6 version. Even with this specified you still may get errors to the log on locating modules that JMP tries to load to provide interoperability. On the Mac JMP 14.0 will have issues if there is more than 1 version of Python3. Mac JMP 14.1 fixes this by using the highest version of Python 3, rather than bailing out if there is more than one.
On my Mac where Python 3.6 is installed in /Library/Frameworks/Python.framework, my Python Init() statement is:
Python Init( Path("/Library/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6.dylib"), Use Python Version("3.6") );
The Path() statetment works on Mac, but not Windows...
On my Windows 10 desktop I have installed Anaconda with Python 3.6 in my C:\local\anaconda3 directory.
The following script runs for me, even though it kicks out the warnings of not finding the modules. To solve the module loading issue, the first thing I do after the init is to import the sys module and then set sys.path to the path value that would be returned if you do the following within the python interpreter, then load those modules within my script before continuing on.
Locating your sys.path from the python interpreter.
C:\local\anaconda3>.\python.exe
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 10:22:32) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print (sys.path)
['', 'C:\\local\\anaconda3\\python36.zip', 'C:\\local\\anaconda3\\DLLs', 'C:\\local\\anaconda3\\lib', 'C:\\local\\anaconda3', 'C:\\local\\anaconda3\\lib\\site-packages', 'C:\\local\\anaconda3\\lib\\site-packages\\win32', 'C:\\local\\anaconda3\\lib\\site-packages\\win32\\lib', 'C:\\local\\anaconda3\\lib\\site-packages\\Pythonwin']
>>>
My modified script:
Names Default To Here( 1 );
Python Init(Use Python Version("3.6"));
Python Submit("\[
import sys
sys.path=['', 'C:\\local\\anaconda3\\python36.zip', 'C:\\local\\anaconda3\\DLLs', 'C:\\local\\anaconda3\\lib', 'C:\\local\\anaconda3', 'C:\\local\\anaconda3\\lib\\site-packages', 'C:\\local\\anaconda3\\lib\\site-packages\\win32', 'C:\\local\\anaconda3\\lib\\site-packages\\win32\\lib', 'C:\\local\\anaconda3\\lib\\site-packages\\Pythonwin']
import numpy as _JMPnp
import scipy as _JMPsp
import pandas as _JMPpd
import sqlite3 as _JMPsq
]\");
x1 = [1, 2, 3];
Python Send( x1 );
x2 = Python Get( x1 );
Show( x1, x2 );
dt1 = Open( "$SAMPLE_DATA/Big Class.jmp" );
Python Send( dt1 );
dt2 = Python Get( dt1 );
dt2 << New Data View;
Close( dt1 );
Python Term();
With the following output in the log
/**********/
# Import the numpy module for array and matrix support
import numpy as _JMPnp
/**********/
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'numpy'
/**********/
# Import the scipy module for scientific computing support
import scipy as _JMPsp
/**********/
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'scipy'
/**********/
# Import the pandas module for Series/Data Frame support
import pandas as _JMPpd
/**********/
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'pandas'
/**********/
# Import the matplotlib module for 2D plotting
import matplotlib as _JMPmpl
/**********/
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'matplotlib'
/**********/
# Import the matplotlib.pyplot module for plots
import matplotlib.pyplot as _JMPpp
/**********/
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'matplotlib'
/**********/
# Set the matplotlib.pyplot interactive flag to false
_JMPpp.interactive(False)
/**********/
Traceback (most recent call last):
File "<string>", line 2, in <module>
NameError: name '_JMPpp' is not defined
Unable to import the 'numpy' Python module
Unable to import the 'scipy' Python module
Unable to import the 'pandas' Python module
Unable to import the 'matplotlib' Python module
x1 = [1, 2, 3];
x2 = [1, 2, 3];
0
Tested against JMP 14.1 and current development.
Again on behalf of JMP Development, I apologize for the raw state of the Python support. Please bear with us as we continue to fix and improve this important feature. Please report problems you find and suggestions for new features.
Thanks.