<?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 How to check if concurrent or single-use licence borrowed using python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-check-if-concurrent-or-single-use-licence/m-p/1279981#M67453</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Since ArcPro 3.0, my python scripts using multiprocessing will only work if I have a single-use licence setup on the machine - previously concurrent licence worked fine, but no longer.&lt;/P&gt;&lt;P&gt;Is there any way to check in python if machine is single-use licenced or concurrent? I want script to end if not single-use, as process takes days otherwise (an no error is thrown)...&lt;/P&gt;&lt;P&gt;I have googled and can't come up with anything.&lt;/P&gt;&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Erin&lt;/P&gt;</description>
    <pubDate>Tue, 18 Apr 2023 23:44:50 GMT</pubDate>
    <dc:creator>erinheinrich</dc:creator>
    <dc:date>2023-04-18T23:44:50Z</dc:date>
    <item>
      <title>How to check if concurrent or single-use licence borrowed using python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-check-if-concurrent-or-single-use-licence/m-p/1279981#M67453</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Since ArcPro 3.0, my python scripts using multiprocessing will only work if I have a single-use licence setup on the machine - previously concurrent licence worked fine, but no longer.&lt;/P&gt;&lt;P&gt;Is there any way to check in python if machine is single-use licenced or concurrent? I want script to end if not single-use, as process takes days otherwise (an no error is thrown)...&lt;/P&gt;&lt;P&gt;I have googled and can't come up with anything.&lt;/P&gt;&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Erin&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2023 23:44:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-check-if-concurrent-or-single-use-licence/m-p/1279981#M67453</guid>
      <dc:creator>erinheinrich</dc:creator>
      <dc:date>2023-04-18T23:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if concurrent or single-use licence borrowed using python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-check-if-concurrent-or-single-use-licence/m-p/1280150#M67457</link>
      <description>&lt;P&gt;This is a headscratcher. Looks like the script is essentially creating more instances of the application/arcpy when it runs, but since you only have one available license it fails. I don't think there is a built in check either.&lt;/P&gt;&lt;P&gt;Could you get with your admin(?) and do one of the following:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN class=""&gt;Sign me in automatically&lt;/SPAN&gt; is checked when signing in to &lt;SPAN class=""&gt;ArcGIS Pro&lt;/SPAN&gt;.&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;ArcGIS Pro&lt;/SPAN&gt; has been authorized to work offline.&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;ArcGIS Pro&lt;/SPAN&gt; is configured with a Concurrent Use license and at least one license is available on the &lt;SPAN class=""&gt;ArcGIS License Manager&lt;/SPAN&gt;.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;As a work around, you could &lt;EM&gt;maybe&lt;/EM&gt; pass the licensed arcpy module to workers (as much as the pickling will let you):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import sys
import arcpy
import multiprocessing as mp


arcpy.env.workspace = "c:/data/world.gdb"

def package_pass(module, int):
    line = None
    if module("ArcInfo") == "Available":
        # arcpy.PolygonToLine_management("Lakes", "LakeLines")
        line = f'Licensed {int}'
    else:
        line = 'Not licensed'
    return line

if __name__ == '__main__':
    with mp.Pool(processes=2) as pool:
        jobs = []
    
        for k in range(10):
            jobs.append(pool.apply_async(package_pass, (arcpy.CheckProduct, k)))

        res = [j.get() for j in jobs]

        for r in res:
            print(r)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 13:34:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-check-if-concurrent-or-single-use-licence/m-p/1280150#M67457</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-04-19T13:34:06Z</dc:date>
    </item>
  </channel>
</rss>

