I’m running a JSL script in JMP 18 that uses Python. On macOS everything works fine, but on Windows I get this error:
Traceback (most recent call last):
File "<string>", line 7, in <module>
ModuleNotFoundError: No module named 'pandas'
In the embedded log is see following:
Creating: C:\\Users\\Admin\\AppData\\Roaming\\JMP\\JMP\\Python\\Python311\\site-packages
This tells me that JMP 18 doesn't install python automatically. Is there a pre-requisite for python be installed?
I am also trying to install this way to ensure the script doesn't fail irrespective of the system:
Python Submit("
import jmputils
required_packages = ['pandas', 'numpy']
# get list of installed python packages
installed = jmputils.jpip('list')
# check & install missing packages
for pkg in required_packages:
if pkg.lower() not in [p.lower() for p in installed]:
print(f'{pkg} not installed — installing...')
jmputils.jpip('install', pkg)
else:
print(f'{pkg} is already installed.')
jmputils.jpip('list')
");