JMP 18 brings native Python. This open-source Python installation uses conda instead of pip, but it seems broken now.
https://github.com/industrial-data/pyJMP/
The way pyJMP works is by executing the following bat file using RunProgram().
set JMP_PYTHON_PTH=C:\ProgramData\miniforge_JMP
CALL %JMP_PYTHON_PTH%\Scripts\activate.bat %JMP_PYTHON_PTH%
SET current_path=%~dp0
echo %current_path:~0,-1%
SET notebook_file=jmp_addin_minimum_features.ipynb
SET notebook_file_path=%current_path%%notebook_file%
echo %notebook_file_path%
python --version
jupyter kernelspec list
start /wait /B "" jupyter nbconvert --execute --to notebook --inplace %notebook_file_path%
Notice that Python is activated first and then we call a function inside Jupyter.
The following error only occurs in JMP 18, which seems to call its own Python installation (v 3.11 instead of 3.10 installed with conda). If one executes that .bat file from Windows Explorer or a different cmd, the code works as expected.
C:\Program Files\JMP\JMPPRO\18>set JMP_PYTHON_PTH=C:\ProgramData\miniforge_JMP
C:\Program Files\JMP\JMPPRO\18>CALL C:\ProgramData\miniforge_JMP\Scripts\activate.bat C:\ProgramData\miniforge_JMP
C:\Users\MrX\AppData\Roaming\JMP\JMP\Addins\Predictor_Explainer
C:\Users\MrX\AppData\Roaming\JMP\JMP\Addins\Predictor_Explainer\jmp_addin_minimum_features.ipynb
Python 3.10.10
Available kernels:
python3 C:\ProgramData\miniforge_JMP\share\jupyter\kernels\python3
[NbConvertApp] Converting notebook C:\Users\MrX\AppData\Roaming\JMP\JMP\Addins\Predictor_Explainer\jmp_addin_minimum_features.ipynb to notebook
[NbConvertApp] ERROR | Module use of python311.dll conflicts with this version of Python.
Traceback (most recent call last):
File \!"C:\ProgramData\miniforge_JMP\lib\site-packages\traitlets\traitlets.py\!", line 656, in get
value = obj._trait_values[self.name]
KeyError: 'kernel_dirs'
It is unclear how to avoid this. Any ideas?