cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
scyrt
Level II

JMP crashes and closes immediately upon running Python Init.

I'm experiencing issues integrating Python with JMP 17. Despite following the recommended steps, JMP crashes every time I run Python Init. Here are the details:

 

System Setup:

  • JMP Version: 17
  • Python Version: 3.9.13 (64-bit) (tried v3.13.1 as well)
  • OS: Windows 10 (64-bit)

Steps Taken:

  1. Installed Python 3.9.13 and added it to the PATH.
  2. Installed required Python packages: numpy, pandas, matplotlib, scipy, PyQt5.
  3. Set the environment variable JMP_PYTHON_MODULE_PATH to C:\Program Files\Python39\python39.dll.
  4. Verified Python installation and package installations via Command Prompt.
  5. Tried running a simple JSL script to initialize Python:
// Initialize Python with the specified path
Python Init( Path( "C:\\Program Files\\Python39\\python39.dll" ) );

// Simple Python code to test initialization
python_code = "
print('Hello from Python!')
";

// Run the Python code
Python Submit(python_code);

// Close the Python session
Python Term();

Issue: JMP crashes and closes immediately upon running Python Init.

Troubleshooting Steps Taken:

  • Verified the Python path and DLL file location.
  • Uninstalled other Python versions to avoid conflicts.
  • Reinstalled JMP 17.
  • Checked JMP logs for error messages (none found).

Despite these efforts, the issue persists. Has anyone else encountered this problem or have any suggestions on how to resolve it?

Thanks in advance for your help!

1 ACCEPTED SOLUTION

Accepted Solutions

Re: JMP crashes and closes immediately upon running Python Init.

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.

 

View solution in original post

6 REPLIES 6
hogi
Level XII

Re: JMP crashes and closes immediately upon running Python Init.

Do you have the possibility to update to JMP18.
the update is free of charge for every user.

Besides many gret improvements, JMP + Python interact as a charm now : )

scyrt
Level II

Re: JMP crashes and closes immediately upon running Python Init.

I wish it is up to me so I can upgrade it, but the company I work for always gets the new software updates at least a year late. 

hogi
Level XII

Re: JMP crashes and closes immediately upon running Python Init.

ouch!

txnelson
Super User

Re: JMP crashes and closes immediately upon running Python Init.

I would contact JMP Support directly an put in a trouble ticket.

     support@jmp.com

Jim

Re: JMP crashes and closes immediately upon running Python Init.

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.

 

scyrt
Level II

Re: JMP crashes and closes immediately upon running Python Init.

thanks, removing env variable and passing the sys.path list to the Python Init worked.