cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
hardner
Level V

JMP 14 Python abilities - working? I'm confused

I'm trying to use the new abilities in JMP 14 to run python and it's not working.  Basically not finding my python install I think though in some circumstances it just crashes. 

 

I saw another discussion  saying there were issues with that in 14.1 and suggesting a workaround about setting environment variables and using Use Python Version("3.6") as an argument to Python Init()   (both of which I tried unsuccessfully).

 

Then I saw in release notes of 14.2 more about this, including a different name for relevant enviroment variable...

https://www.jmp.com/support/help/14-2/how-jmp-finds-python-on-windows.shtml

 

So, I went to upgrade from 14.1 and saw there is now 14.3 and got that. when I try the environment variable instructions from the 14.2 post I get a message saying that is deprecated and now it should be JMP_PYTHON_MODULE_PATH.  So I tried that, I think with a valid path to the right file, using same format from the 14.2 post,  but still not working.  Occured to me to try this in my JMP15 early adopter version as well and got same results, same message that the environment variable should be called JMP_PYTHON_MODULE_PATH.

 

In all cases (14.1, 14.3, 15 early adopter,  various versions of environment variables)  if I have no argument in Python Init(),  JMP crashes right away on that line.  If I have the UsePythonVersion("3.6") in there it comes back with an error saying it can't find Python at all..

 

An installation of Python cannot be found on this system. JMP Python support requires Python version 3.0 or higher. in access or evaluation of 'Python Init' , Python Init/*###*/(Use Python Version( "3.6" ))

 

Is anyone using this successfully?  If so are you putting something inside Python Init()? 

or if you used setting an environment variable what is it called and what does it look like?  Any further troubleshooting advice?

 

Here's what my latest attempt at environment variable looks like... is this not the right format? (the earlier post looked like environment variable had curly brackets and double quotes like JMP wanted to see is as a JSL list format but this looks like what the 4.2 post is saying to do and other format didn't work for me either...  A python36.dll file really does seem to be in this location... env variable issue.png

 

Not sure if I'm having a freak problem specific to my system that I need tech support on or whether I just don't get the latest verison of how this is supposed to work.

31 REPLIES 31

Re: JMP 14 Python abilities - working? I'm confused

We were able replicate on a development machine, the sudden exit of JMP when trying to load Python 3.7.  It turns out we (JMP) are not alone in having problems with Python 3.7, and Python 3.8 especially in an embedded case.  The error we got from Python is:

 

Fatal Python error: unable to load the file system codec

Unhandled exception at 0x00007FFE84F9B64E (ucrtbase.dll) in Jmp.exe: Fatal program exit requested.

 

The solution at present, is to either use Python 3.6.5 or newer 3.6.x, or you have to install Python 3.7.x on Windows as an install for all users, not just you the local user AND you MUST choose the option to put the Python in your PATH.  This directly contradicts Anaconda3's install dialog, warning about not putting it in the path.  

 

My development machine works fine with 3.7.1 installed as a system wide install and is the default Python on the Path.  My co-worker's machine where we were able to replicate the sudden abort of JMP, we installed Python 3.7.1 using the default install options which made a local install not on the path.  We were able to keep JMP from exiting by setting the environment variable PYTHONHOME= 'the anaconda3 directory'  But even here we couldn't get it to load numpy, scipi, pandas, or sqlite3, even from a console prompt.   Where on my machine all works as expected. 

FN
FN
Level VI

Re: JMP 14 Python abilities - working? I'm confused

Installing for all user also requires admin rights, which is not convenient when distributing an add-in that calls Python.

Will the documentation of JMP 15 include what has been discussed in here?

Re: JMP 14 Python abilities - working? I'm confused

I'm not sure I understand your question.  Installing Python for all users does indeed require admin access, but using the installed Python does not require admin access.  A JMP add-in that called Python would not require admin access to install or run.  Yes additional Python packages that are installed for all users would require admin access.  You should be able to install site local packages on a per user basis that would not require admin to install.  This is something I have been meaning to test, but have had a chance to try.  It might require you updating the sys.path to add the location of the site local packages.

 

As for JMP 15 documentation, I know some of this discussion has made it in.  Unfortunately, not everything has made it into docs before the cutoff.  We'll work on getting the rest of it in through the maintenance releases.

FN
FN
Level VI

Re: JMP 14 Python abilities - working? I'm confused

I can confirm that with Windows 10 and JMP 14.2 it works out of the box, if:

 

Anaconda Python 3.6* 64bit is installed > https://repo.continuum.io/archive/Anaconda3-5.2.0-Windows-x86_64.exe;

and the PATH option is activated (no admin rights required)

an.png

 

My point was more about the capability of deploying addins with a portable Python version so users do not need to hassle with the Anaconda installation, environments and versioning.

 

Thanks for the help. Looking forward to seeing a great Python integration in the following updates.

 

(*) With the current version of Anaconda, JMP crashes with this config.

FN
FN
Level VI

Re: JMP 14 Python abilities - working? I'm confused

JMP 15.0 still suffers from the same issue. I installed the linked Anaconda without the PATH option and it worked.

 

Note that this package is quite old, so you will need to conda update your packages being careful not to go to update Python itself 3.6.5 (3.6.9 didn't worked for me).

 

I hope its fixed in next releases.


@FN wrote:

I can confirm that with Windows 10 and JMP 14.2 it works out of the box, if:

 

Anaconda Python 3.6* 64bit is installed > https://repo.continuum.io/archive/Anaconda3-5.2.0-Windows-x86_64.exe;

and the PATH option is activated (no admin rights required)

an.png

 

My point was more about the capability of deploying addins with a portable Python version so users do not need to hassle with the Anaconda installation, environments and versioning.

 

Thanks for the help. Looking forward to seeing a great Python integration in the following updates.

 

(*) With the current version of Anaconda, JMP crashes with this config.


hardner
Level V

Re: JMP 14 Python abilities - working? I'm confused

Hello!

 

Just butting back into this thread as OP to say...

 

- I've been using Python more since my original post and what I said was working for me has continued to work.  :)

 

- I appreciate efforts to support Python, more so now I have found specific things to use it for. Thanks!

 

- Like FN I find sharing addins that call Python problematic. I do share a lot of addins.  I'm using this now just for myself and for jobs that I run that then share outcomes with others but not in scripts to be run by others.  I'd have to give complicated instructions on installing Python and packages and worry about the specific versions working together (same issue occurs with R which I use but not in shared scripts).  But if a particular version were encapsulated within JMP it would limit what we can do with it.   Still think maybe supporting virutal environments could help, then I could instruct and support users on setting up an installation to my specfications for a particular tool they want to use and not interfere with any other Python activities on their machine.  But not really sure what would be best and not that keen to troubleshoot users Python installations. So just agreeing it's not ideal and noting I do have some interest in making more use of this ability.

 

Thanks!

nascif_jmp
Level VI

Re: JMP 14 Python abilities - working? I'm confused

Hi there @hardner,

Good to know you have been using Python with JMP more. If you can share what you have been doing, we would love to know!

Regarding support for virtual environments, I hear you. It does make a big difference in terms of keeping your dependencies organized, AND helping your co-workers reproduce your environment in order to run your addins.

Which is why I put together a little library that helps with that very problem. Please check:

https://community.jmp.com/t5/JMP-Scripts/Anaconda-Environments-Integration/ta-p/221565

Lots of examples, tested in 14.3 and 15.1. But, at least for now, Windows-only and Anaconda-specific.

Let me know if it works for you!

hardner
Level V

Re: JMP 14 Python abilities - working? I'm confused

This looks great - thanks!  I don't have time to test it out for at least a couple of weeks (and I completely redid my Python install w/o virtual environment so will take some doing to try this) but I will be keen to test this out soon.

 

The thing that really jump started my Python use is classifying images with tensorflow and keras.  I'm running a JMP script that queries up relevant images and calls python to run my model and then pushes results to Oracle.  That entire task is something I will probably end up doing in Python but which I'm doing in JSL because I'm much more proficient in that so far - just learning in Python- and I already have a whole scheme for running JSL automated jobs, have functions built for pushing tables to our Oracle,  etc. 

 

However, while I thought that whole project would not be inherently JMP-related I actually found that having images in a JMP table alongside other data where they can be interacted with in all the usual JMP ways is really useful - sorting, selecting based on other data columns, etc.. That spurred me to do a number of other image-related addins.  Remains to be seen whether in the end there's a true need in my project to call up the Python during a live interactive JMP session or they can be separate ( a tool that reviews tf model results interactively just querying up results from Oracle, not directly calling Python to run models live?) but I'm currently using them together.

 

Anyway, that's the not-in-JMP thing I'm using Python for now. I'm trying to learn more Python and have colleagues who are expert in it and I feel likely to find more things where I might like to actually call Python to join its abilities with JMP.

 

Thanks!

nascif_jmp
Level VI

Re: JMP 14 Python abilities - working? I'm confused

Nice! That is a great use case.
As you search for the ideal JMP + Python workflow, it is worth noting that JMP (Pro) can generate Python scoring code for JMP models. That supports integration in the other direction: pushing JMP capabilities into the Python world.
For example, say you wanted to apply a JMP model to a large data table in Oracle, you could convert the model to Python and score it in the database using UDFs (support seems to be experimental though):
https://oracle.github.io/oracle-db-mle/python/
Or you could share your JMP model with your Python colleague so that she could run it in a Jupyter notebook, and so on.
Also, JMP 15.0 will make it easier to display external images as thumbnails in your data visualization tooltips. That would reduce/eliminate the need to import them directly to your JMP tables, keeping them smaller. There is a performance cost of course, but it might be a worthy trade-off. Keep an eye out for that.
Thanks for sharing! Keep us posted on your journey!

FN
FN
Level VI

Re: JMP 14 Python abilities - working? I'm confused

Regarding deployment, I think it will be fine as soon as Python does not interfer with other user installations.

 

For example, I am trying to call Python from JMP 15 EA8 which is in one specific folder.

 

This folder contains all the instalation files of Anaconda/miniconda, which I copied to a folder before uninstalling it. The code worked when it was installed. Now, it seems that JMP does not use the path I am specifying.

 

Set Environment Variable( "JMP_PYTHON_MODULE_PATH", 
	"\["", "C:/Users/xxx/JMP_scripting/python/miniconda3/python36.zip", 
	"C:/Users/xxx/JMP_scripting/python/miniconda3/DLLs", 
	"C:/Users/xxx/JMP_scripting/python/miniconda3/lib", 
	"C:/Users/xxx/JMP_scripting/python/miniconda3", 
	"C:/Users/xxx/JMP_scripting/python/miniconda3/lib/site-packages", 
	"C:/Users/xxx/JMP_scripting/python/miniconda3/lib/site-packages/win32", 
	"C:/Users/xxx/JMP_scripting/python/miniconda3/lib/site-packages/win32/lib", 
	"C:/Users/xxx/JMP_scripting/python/miniconda3/lib/site-packages/Pythonwin"]\"
);


Python Init (Path("C:\Users\xxx\JMP_scripting\python\miniconda3"), 
Init Trace("TRUE"), 
Debug Print Statements ("TRUE"),
Debug Print Output("TRUE") );


Python Submit( "\[basket = ["apple", "orange", "pear"]
print(basket)]\" );
Python Term();

 

 

Error in JMP 15 EA8

error.png

Error in JMP Pro 14.2:

An installation of Python cannot be found on this system. JMP Python support requires Python version 3.0 or higher. in access or evaluation of 'Python Init' , Python Init/*###*/(Path(
"C:\Users\xxx\JMP_scripting\python\miniconda3"
))