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

Configure Python (Anaconda environment path) with JMP Pro 16.2

Hi,

I have seen someone being successful with configuring Python and JMP using an Anaconda environment that contains TensorFlow in the following link ( Integrating JMP with Anaconda Python and Tensorflow ). I want to do the same thing. However, if I follow the steps that are described in that link, it still doesn't work for me. I think this is because I'm using a newer version of JMP Pro (I've got JMP Pro 16.2).

 

So far, I have tried following JMP documentation and some advise in other forum threads. I have done the following things:

 

- checked that JMP, Python and Windows all have the same bits (they are all 64 bits)

 

- set JMP_LIB_PYTHON_PATH to C:\Users\xxxxxxxx\Anaconda3\envs\jmp_dl\python38.dll (accessible through Windows 10 Pro Control Panel > System > Advanced System Settings > Environment Variables)

 

- set JMP_PYTHON_MODULE_PATH to C:\Users\xxxxxxxx\Anaconda3\envs\jmp_dl\Lib (accessible as above)

 

When I run the following code:

 

Names Default To Here( 1 );
Python Init(Init Trace("TRUE"));
Show(Python Get Version());
Python Term();

I get the following output:

C:\Users\xxxxxxxxx\Anaconda3\envs\jmp_dl\python38.dll

Starting JMP to Python interface initialization
AFTER:

/**********/
print(_JMPsys.path)
/**********/
['C:\\Users\\xxxxxxxxx\\Anaconda3\\envs\\jmp_dl\\Lib']

/**********/
# Import the numpy module for array and matrix support
import numpy as _JMPnp
/**********/

/**********/
# Import the pandas module for Series/Data Frame support
import pandas as _JMPpd
/**********/

/**********/
# Import the sqlite3 module for Series/Data Frame support
import sqlite3 as _JMPsq
/**********/

/**********/
# Import the matplotlib module for 2D plotting
import matplotlib as _JMPmpl
/**********/

/**********/
# Set matplot lib to use non-gui backend Agg.
_JMPmpl.use('Agg')
/**********/

/**********/
# Import the matplotlib.pyplot module for plots
import matplotlib.pyplot as _JMPpp
/**********/

Unable to import the 'numpy' Python module
in access or evaluation of 'Python Init' , Python Init/*###*/(Init Trace( "TRUE" ))

Unable to import the 'pandas' Python module
in access or evaluation of 'Python Init' , Python Init/*###*/(Init Trace( "TRUE" ))

Unable to import the 'sqlite3' Python module
in access or evaluation of 'Python Init' , Python Init/*###*/(Init Trace( "TRUE" ))

Unable to import the 'matplotlib' Python module
in access or evaluation of 'Python Init' , Python Init/*###*/(Init Trace( "TRUE" ))

at line 3 in C:\Users\xxxxxxxxxx\xxxxxxxx\Documents\python_code_for_jmp_1.jsl
Python Get Version() = {3, 8, 10, "final", 0};
0

Important thing to note: it's finding the correct version of Python (3.8.10, which is used only in that Anaconda environment).

What it is not finding is any of the Python modules (matplotlib, numpy, pandas), or sqlite3 etc.

 

I have tried doing other things as well, but all result in either 1) complete shutdown/ crash of JMP Pro 16.2, or 2) some kind of JMP Alert.

 

Can someone please guide me through the process of setting up my Windows 10 Pro Environment Variables in such a way that JMP Pro 16.2 finds not only the correct Python version, but all the Python modules that it needs, as well.

 

Any ideas would be much appreciated! Thank you.

2 REPLIES 2

Re: Configure Python (Anaconda environment path) with JMP Pro 16.2

Hi @ab_datascience,

Most likely those packages specified (matplotlib, pandas, etc.) are installed in a location that JMP cannot access. 

Common causes might be related to packages installed in virtual environments or within restricted permissions folders. 

Verify that the required packages are freely available for all users on your machine.

 

The JMP documentation page below offer some additional guidance:

https://www.jmp.com/support/help/en/16.0/#page/jmp/install-python.shtml#

Nicholas.Shelton@jmp.com

Re: Configure Python (Anaconda environment path) with JMP Pro 16.2

Anaconda does not play nice with others, it wants to be in complete control of the environment.  It does some nonstandard things with library paths and initialization.  To have success with Anaconda, thinly way I have succeeded is to utilize the optional arguments to the the Python Init() statement.  You must use both the Python Sys Path() and Path() arguments.  The first takes the sys.path as the specific version of Python sees it, and is in the form of a JSL list. 

 

import sys

print(sys.path)

The Path() argument should be the full path to the python3x.dll, one in the virtual environment if that's what you are trying to use.  JMP 16.2 Windows tries to add additional Anaconda library paths to JMP's LoadLibrary Path to be able to find the shared libraries that Anaconda needs.  

 

The other point is that if you are trying to run from a Python Virtual environment, you must utilize the Python Sys Path() argument. The default mechanism for locating Python looks in the registry, and the virtual environments are not in the registry to find, just the default installations such as the Anaconda base.