<?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 Re: Install and use local custom Python module in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Install-and-use-local-custom-Python-module/m-p/820929#M99987</link>
    <description>&lt;P&gt;Excellent, thanks Paul.&lt;/P&gt;</description>
    <pubDate>Thu, 05 Dec 2024 19:35:45 GMT</pubDate>
    <dc:creator>robot</dc:creator>
    <dc:date>2024-12-05T19:35:45Z</dc:date>
    <item>
      <title>Install and use local custom Python module</title>
      <link>https://community.jmp.com/t5/Discussions/Install-and-use-local-custom-Python-module/m-p/820454#M99907</link>
      <description>&lt;P&gt;Is there a best practice to install and use a local Python module in the JSL environment?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I read the documentation at&amp;nbsp;&lt;A href="https://www.jmp.com/support/help/en/18.1/index.shtml#page/jmp/install-python-packages-using-jsl.shtml#" target="_self"&gt;Install Python Packages using JSL&lt;/A&gt;, and this seems geared for standard libraries.&amp;nbsp; Is there a default location where JMP looks for custom modules?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to manage&amp;nbsp;custom module&amp;nbsp;updates using JSL?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are there any differences for working with custom&amp;nbsp;modules, packages, or libraries?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 21:32:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Install-and-use-local-custom-Python-module/m-p/820454#M99907</guid>
      <dc:creator>robot</dc:creator>
      <dc:date>2024-12-03T21:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: Install and use local custom Python module</title>
      <link>https://community.jmp.com/t5/Discussions/Install-and-use-local-custom-Python-module/m-p/820665#M99942</link>
      <description>&lt;P&gt;How do you manage them when you are not using JMP? Most likely you could utilize something similar when using JMP.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 16:36:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Install-and-use-local-custom-Python-module/m-p/820665#M99942</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-12-04T16:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: Install and use local custom Python module</title>
      <link>https://community.jmp.com/t5/Discussions/Install-and-use-local-custom-Python-module/m-p/820928#M99986</link>
      <description>&lt;P&gt;JMP will just 'find it' if it is in the same directory as the launching .jsl or .py script. &amp;nbsp;There is an issue in JMP 18.0 if the launching script is .jsl, it doesn't find the .py import. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It should work fine from both .jsl or .py scripts in 18.1+&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The other way is to create a pyproject.toml file, put the script into a directory of the same name as the file and an appropriate pyproject.toml file. &amp;nbsp;This makes it an installable package which jpip can then install into the JMP site-packages/ location. &amp;nbsp;See Python.org's docs or many other tutorials on creating installable Python packages. &amp;nbsp;Such as: &lt;A href="https://til.simonwillison.net/python/pyproject" target="_blank"&gt;https://til.simonwillison.net/python/pyproject&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;The code below is quick and dirty and probably doesn't follow python best practices. &amp;nbsp;I think there is usually an __init__.py file and __main__.py or main.py instead of the file matching the package directory... &amp;nbsp;But the toml file lets you specify lots if things including dependancies as show below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dt2pandas/&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; dt2pandas.py&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; pyproject.toml&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;pyproject.toml&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;[project]&lt;BR /&gt;name = "dt2pandas"&lt;BR /&gt;description = "jmp.DataTable to pandas.DataFrame example"&lt;BR /&gt;authors = [ &lt;BR /&gt;{ name = "Paul R. Nelson", email = "paul.nelson@jmp.com" } &lt;BR /&gt;]&lt;/P&gt;
&lt;P&gt;version = "0.1"&lt;BR /&gt;dependencies = [ "pandas" ]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At which point you can do a&lt;/P&gt;
&lt;P&gt;jmputils.jpip('install', '-e _my_path_to/&lt;A href="https://til.simonwillison.net/python/pyprojectdt2pandas')" target="_blank"&gt;dt2pandas')&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 19:29:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Install-and-use-local-custom-Python-module/m-p/820928#M99986</guid>
      <dc:creator>Paul_Nelson</dc:creator>
      <dc:date>2024-12-05T19:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Install and use local custom Python module</title>
      <link>https://community.jmp.com/t5/Discussions/Install-and-use-local-custom-Python-module/m-p/820929#M99987</link>
      <description>&lt;P&gt;Excellent, thanks Paul.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 19:35:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Install-and-use-local-custom-Python-module/m-p/820929#M99987</guid>
      <dc:creator>robot</dc:creator>
      <dc:date>2024-12-05T19:35:45Z</dc:date>
    </item>
  </channel>
</rss>

