<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Launching python code from  a JSL script  on a server in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Launching-python-code-from-a-JSL-script-on-a-server/m-p/826648#M100782</link>
    <description>&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;strCommand = “Path\to\virutual_env\.venv\Scripts\activate.bat\!” &amp;amp;&amp;amp; python \!“Path\to\python_script.py\!””;
Run Program( Executable( “cmd.exe” ), Options( “/C ” || strCommand ) );&lt;/CODE&gt;&lt;/PRE&gt;&lt;UL&gt;&lt;LI&gt;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” &amp;amp;&amp;amp; python “Path\to\python_script.py\”,&amp;nbsp; it works&lt;/LI&gt;&lt;LI&gt;If I run this JSL code on my PC, it also works.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;However, if I run this JSL code on the server, it doesn't work anymore. No python is run, but no error message.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone had the same issue ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jan 2025 12:50:45 GMT</pubDate>
    <dc:creator>SophieCuvillier</dc:creator>
    <dc:date>2025-01-10T12:50:45Z</dc:date>
    <item>
      <title>Launching python code from  a JSL script  on a server</title>
      <link>https://community.jmp.com/t5/Discussions/Launching-python-code-from-a-JSL-script-on-a-server/m-p/826648#M100782</link>
      <description>&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;strCommand = “Path\to\virutual_env\.venv\Scripts\activate.bat\!” &amp;amp;&amp;amp; python \!“Path\to\python_script.py\!””;
Run Program( Executable( “cmd.exe” ), Options( “/C ” || strCommand ) );&lt;/CODE&gt;&lt;/PRE&gt;&lt;UL&gt;&lt;LI&gt;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” &amp;amp;&amp;amp; python “Path\to\python_script.py\”,&amp;nbsp; it works&lt;/LI&gt;&lt;LI&gt;If I run this JSL code on my PC, it also works.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;However, if I run this JSL code on the server, it doesn't work anymore. No python is run, but no error message.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone had the same issue ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2025 12:50:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Launching-python-code-from-a-JSL-script-on-a-server/m-p/826648#M100782</guid>
      <dc:creator>SophieCuvillier</dc:creator>
      <dc:date>2025-01-10T12:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: Launching python code from  a JSL script  on a server</title>
      <link>https://community.jmp.com/t5/Discussions/Launching-python-code-from-a-JSL-script-on-a-server/m-p/826685#M100787</link>
      <description>&lt;P&gt;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:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Can you access the path correctly?&lt;/LI&gt;
&lt;LI&gt;Can you run Python?&lt;/LI&gt;
&lt;LI&gt;Can you activate venv?&lt;/LI&gt;
&lt;LI&gt;And so on&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Fri, 10 Jan 2025 14:53:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Launching-python-code-from-a-JSL-script-on-a-server/m-p/826685#M100787</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-01-10T14:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: Launching python code from  a JSL script  on a server</title>
      <link>https://community.jmp.com/t5/Discussions/Launching-python-code-from-a-JSL-script-on-a-server/m-p/827280#M100879</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much! In fact, the problem was that there was a space in the path&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2025 08:34:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Launching-python-code-from-a-JSL-script-on-a-server/m-p/827280#M100879</guid>
      <dc:creator>SophieCuvillier</dc:creator>
      <dc:date>2025-01-14T08:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: Launching python code from  a JSL script  on a server</title>
      <link>https://community.jmp.com/t5/Discussions/Launching-python-code-from-a-JSL-script-on-a-server/m-p/827281#M100880</link>
      <description>&lt;P&gt;How did you solve that issue? Did you "fix" the file path or try to figure out how it should be quoted for JMP / commandline to understand what you are trying to do?&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2025 08:36:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Launching-python-code-from-a-JSL-script-on-a-server/m-p/827281#M100880</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-01-14T08:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: Launching python code from  a JSL script  on a server</title>
      <link>https://community.jmp.com/t5/Discussions/Launching-python-code-from-a-JSL-script-on-a-server/m-p/828270#M101000</link>
      <description>&lt;P&gt;As I had to do a quick fix, I first removed the spaces in the path. I must admit that I didn't come back to the subject afterwards...&amp;nbsp;but I'm in discussion with JMP support. They suggest using Python from JMP18, but they don't support virtual environments, so you'd have to install the package versions directly from them. And I have customers who are ‘only’ using JMP 17 at the moment and would like the same thing.I'll keep you posted&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2025 14:23:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Launching-python-code-from-a-JSL-script-on-a-server/m-p/828270#M101000</guid>
      <dc:creator>SophieCuvillier</dc:creator>
      <dc:date>2025-01-20T14:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: Launching python code from  a JSL script  on a server</title>
      <link>https://community.jmp.com/t5/Discussions/Launching-python-code-from-a-JSL-script-on-a-server/m-p/828271#M101001</link>
      <description>&lt;P&gt;&lt;LI-MESSAGE title="Pass quote into Run Program application" uid="207567" url="https://community.jmp.com/t5/Discussions/Pass-quote-into-Run-Program-application/m-p/207567#U207567" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;has one option. I have used something similar when I had to pass quotes to Run Program and if I remember correctly also some other methods.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2025 14:49:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Launching-python-code-from-a-JSL-script-on-a-server/m-p/828271#M101001</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-01-20T14:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: Launching python code from  a JSL script  on a server</title>
      <link>https://community.jmp.com/t5/Discussions/Launching-python-code-from-a-JSL-script-on-a-server/m-p/828275#M101004</link>
      <description>&lt;P&gt;&lt;A href="https://community.jmp.com/t5/Discussions/Unable-to-parse-speechmarks-quot-quot-into-powershell-using/m-p/245968/highlight/true#M48328" target="_blank"&gt;https://community.jmp.com/t5/Discussions/Unable-to-parse-speechmarks-quot-quot-into-powershell-using/m-p/245968/highlight/true#M48328&lt;/A&gt; ( in&amp;nbsp; &lt;LI-MESSAGE title="Unable to parse speechmarks &amp;amp;quot;&amp;amp;quot; into powershell using RunProgram" uid="219820" url="https://community.jmp.com/t5/Discussions/Unable-to-parse-speechmarks-quot-quot-into-powershell-using/m-p/219820#U219820" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;) has links to an explanation of why the windows command line quoting is so hard. Removing the spaces in a path name is a great choice.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2025 15:37:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Launching-python-code-from-a-JSL-script-on-a-server/m-p/828275#M101004</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2025-01-20T15:37:28Z</dc:date>
    </item>
  </channel>
</rss>

