As mentioned by others, JMP 18 makes your life much easier with respect to Python. JMP installs a private embedded Python 3.11 that works out of the box with JMP. Getting Python working with JMP 14-17 can be challenging, and was the major reason JMP now ships with Python.
First remove the environment variable. JMP_PYTHON_MODULE_PATH
Second, are you running Python.org or Anaconda? Use Python.org.
Third, JMP 17 is 64-bits, you must be using 64-bit Python.
I was able to make Anaconda work, but only by stepping through JMP source code in the debugger to properly configure the Python Init.
Also JMP 14-17 is not designed to work with virtual environments ( venv ).
The Python Connect() and Python Init() functions take a variety of parameters that can solve the problem.
The simplest to try is:
Python Init ( Use Python Version("3.9") );
You have already tried the:
Python Init (
Path("C:\\Users\\_me_\\AppData\\Local\\Programs\\Python\\Python39\\python39.dll")
);
Finally, the 'brute force' way is to specify both the path to the dll, and the full Python sys.path as a JSL list. Launch Python from the command line and run the following.
import sys
print ( sys.path )
Giving the following on my machine:
Python 3.9.2 (tags/v3.9.2:1a79785, Feb 19 2021, 13:44:55) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.path)
['', 'C:\\Users\\_me_\\AppData\\Local\\Programs\\Python\\Python39\\python39.zip', 'C:\\_me_\\panels\\AppData\\Local\\Programs\\Python\\Python39\\DLLs', 'C:\\Users\\_me_\\AppData\\Local\\Programs\\Python\\Python39\\lib', 'C:\\Users\\_me_\\AppData\\Local\\Programs\\Python\\Python39', 'C:\\Users\\_me_\\AppData\\Roaming\\Python\\Python39\\site-packages', 'C:\\Users\\_me_\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages', 'C:\\Users\\_me_\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\win32', 'C:\\Users\\_me_\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\win32\\lib', 'C:\\Users\\_me_\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\Pythonwin']
>>>
Now you can take the Python list [ ... ] and create a JSL list from that to pass to Python Init() as shown below. Here the two differ since the script below is pasted from a script I ran some time ago. I ran the above Python today. When in doubt use everything that Python itself returns for its sys.path.
Names Default To Here( 1 );
Python Init(
Path("C:\\Users\\_me__\\AppData\\Local\\Programs\\Python\\Python39\\python39.dll"),
Python Sys Path(
{
"",
"C:\\Users\\_me_\\AppData\\Local\\Programs\\Python\\Python39\\python39.zip",
"C:\\Users\\_me_\\AppData\\Local\\Programs\\Python\\Python39\\DLLs",
"C:\\Users\\_me_\\AppData\\Local\\Programs\\Python\\Python39\\lib",
"C:\\Users\\_me_\\AppData\\Local\\Programs\\Python\\Python39",
"C:\\Users\\_me_\\AppData\\Roaming\\Python\\Python39\\site-packages",
"C:\\Users\\_me_\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages"
}
)
);
Python Submit("\[
import sys
print(sys.path)
print(sys.version)
]\");
x1 = [1, 2, 3];
Python Send( x1 );
x1 = [3,2,1];
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();
Python Submit("\[
print(dt1)
]\");
Beyond that... Upgrade to JMP 18.