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

Launching python code from a JSL script on a server

Hello all, 

 

In a server (without internet connection), I have a JSL script that calls at some point a python script (in a virtual environment). Below is the JSL command that calls the python. The python is stored in a F:\ Disk.


strCommand = “Path\to\virutual_env\.venv\Scripts\activate.bat\!” && python \!“Path\to\python_script.py\!””;
Run Program( Executable( “cmd.exe” ), Options( “/C ” || strCommand ) );
  • If I run the same command directly in the server command prompt (in administrator mode or not):“Path\to\virutual_env\.venv\Scripts\activate.bat” && python “Path\to\python_script.py\”,  it works
  • If I run this JSL code on my PC, it also works.

However, if I run this JSL code on the server, it doesn't work anymore. No python is run, but no error message. 

 

For information: as I don't have Internet access, for the python virtual environment I manually transferred the packages to the server and activated the environment to read the packages.

 

Anyone had the same issue ?

 

 

1 REPLY 1
jthi
Super User

Re: Launching python code from a JSL script on a server

Do you have the same paths on your PC and on the server? Does either of them have any spaces in the paths (there could potentially be some issues with the quotes when using Run Program)? Start breaking the problem into smaller parts:

  1. Can you access the path correctly?
  2. Can you run Python?
  3. Can you activate venv?
  4. And so on
-Jarmo