<?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: Multiple versions of custom libraries on the cluster in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/multiple-versions-of-custom-libraries-on-the-cluster/m-p/7598#M3416</link>
    <description>&lt;P&gt;@Priya K​&amp;nbsp;: Glad that my suggestions are helping you! You could go ahead and mark both as the best answers &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; This works just fine.&lt;/P&gt;</description>
    <pubDate>Fri, 07 Apr 2023 01:45:36 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-04-07T01:45:36Z</dc:date>
    <item>
      <title>Multiple versions of custom libraries on the cluster</title>
      <link>https://community.databricks.com/t5/data-engineering/multiple-versions-of-custom-libraries-on-the-cluster/m-p/7591#M3409</link>
      <description>&lt;P&gt;Using the install_libraries API, I installed a custom Python whl file on a running cluster. For certain types of requests, we have a requirement to install a different version of the same custom whl file in the running cluster. My problem is that uninstalling the previous version does not take effect until the&amp;nbsp;cluster is restarted. So when I install the new version of the library, is there a way for me to force the cluster to use the "newly installed version" instead of the "uninstalled, pending restart" version?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 20:22:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/multiple-versions-of-custom-libraries-on-the-cluster/m-p/7591#M3409</guid>
      <dc:creator>priyak</dc:creator>
      <dc:date>2023-03-16T20:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple versions of custom libraries on the cluster</title>
      <link>https://community.databricks.com/t5/data-engineering/multiple-versions-of-custom-libraries-on-the-cluster/m-p/7592#M3410</link>
      <description>&lt;P&gt;@Priya K​&amp;nbsp;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you install a custom library using the install_libraries API in Databricks, the installed version is cached on the worker nodes until the cluster is restarted. Uninstalling the library will remove it from the cache, but it will still be loaded in memory by any running tasks until the cluster is restarted.&lt;/P&gt;&lt;P&gt;To force the cluster to use the newly installed version of the library, you can try a few options:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Use a new cluster: You can create a new cluster and install the new version of the library on that cluster. This way, you can ensure that the new version of the library is used without any conflicts with the old version.&lt;/LI&gt;&lt;LI&gt;Reload the module: If you have already installed the new version of the library and want to start using it in your code without restarting the cluster, you can try reloading the module using importlib.reload(). This will reload the module and use the new version of the library.&lt;/LI&gt;&lt;LI&gt;Restart the Python interpreter: You can also try restarting the Python interpreter by using the os.execv() function. This will restart the Python interpreter and load the new version of the library.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;However, keep in mind that these options may have some limitations and risks depending on your use case. For example, reloading the module or restarting the Python interpreter may cause some inconsistencies or conflicts with the existing tasks running on the cluster. Additionally, creating a new cluster may increase your overall costs and may not be feasible for all use cases.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Mar 2023 06:37:13 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/multiple-versions-of-custom-libraries-on-the-cluster/m-p/7592#M3410</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-25T06:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple versions of custom libraries on the cluster</title>
      <link>https://community.databricks.com/t5/data-engineering/multiple-versions-of-custom-libraries-on-the-cluster/m-p/7593#M3411</link>
      <description>&lt;P&gt;Hi @Priya K​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for posting your question in our community! We are happy to assist you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To help us provide you with the most accurate information, could you please take a moment to review the responses and select the one that best answers your question?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will also help other community members who may have similar questions in the future. Thank you for your participation and let us know if you need any further assistance!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Mar 2023 10:49:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/multiple-versions-of-custom-libraries-on-the-cluster/m-p/7593#M3411</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-25T10:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple versions of custom libraries on the cluster</title>
      <link>https://community.databricks.com/t5/data-engineering/multiple-versions-of-custom-libraries-on-the-cluster/m-p/7594#M3412</link>
      <description>&lt;P&gt;Thank you for the response. Are there any ways to mitigate the risks of options 2 and 3? Is it possible to check whether the existing tasks are completed and the cluster is an idle state before we attempt to reload the module/restart the interpreter?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 16:15:22 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/multiple-versions-of-custom-libraries-on-the-cluster/m-p/7594#M3412</guid>
      <dc:creator>priyak</dc:creator>
      <dc:date>2023-03-27T16:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple versions of custom libraries on the cluster</title>
      <link>https://community.databricks.com/t5/data-engineering/multiple-versions-of-custom-libraries-on-the-cluster/m-p/7595#M3413</link>
      <description>&lt;P&gt;@Suteja Kanuri​&amp;nbsp;Any thoughts on the above question?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2023 17:19:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/multiple-versions-of-custom-libraries-on-the-cluster/m-p/7595#M3413</guid>
      <dc:creator>priyak</dc:creator>
      <dc:date>2023-04-05T17:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple versions of custom libraries on the cluster</title>
      <link>https://community.databricks.com/t5/data-engineering/multiple-versions-of-custom-libraries-on-the-cluster/m-p/7596#M3414</link>
      <description>&lt;P&gt;@Priya K​&amp;nbsp;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, there are some ways to mitigate the risks of options 2 and 3:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;To mitigate the risks of using option 2 (reloading the module), you can try to limit the scope of the module reload to a specific part of your code that doesn't have any running tasks that use the old version of the library. For example, you can use a try-except block to catch any exceptions that might be raised during the reload process, and then retry the operation later when the cluster is idle.&lt;/LI&gt;&lt;LI&gt;To mitigate the risks of using option 3 (restarting the Python interpreter), you can try to schedule the restart during a maintenance window when there are no running tasks on the cluster. You can also use a similar try-except block as in option 2 to catch any exceptions that might be raised during the restart process, and then retry the operation later when the cluster is idle.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Regarding your second question, it is possible to check whether the existing tasks are completed and the cluster is idle before attempting to reload the module or restart the interpreter. One way to do this is by monitoring the active task count and cluster utilization using the Databricks REST API or the Databricks CLI. You can also use the Databricks Jobs API to schedule the module reload or interpreter restart during a specific time window when there are no running tasks on the cluster.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 04:14:45 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/multiple-versions-of-custom-libraries-on-the-cluster/m-p/7596#M3414</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-06T04:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple versions of custom libraries on the cluster</title>
      <link>https://community.databricks.com/t5/data-engineering/multiple-versions-of-custom-libraries-on-the-cluster/m-p/7597#M3415</link>
      <description>&lt;P&gt;@Suteja Kanuri​&amp;nbsp;Thanks for your suggestions. Please combine both your responses, I will mark that as the best answer.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 00:21:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/multiple-versions-of-custom-libraries-on-the-cluster/m-p/7597#M3415</guid>
      <dc:creator>priyak</dc:creator>
      <dc:date>2023-04-07T00:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple versions of custom libraries on the cluster</title>
      <link>https://community.databricks.com/t5/data-engineering/multiple-versions-of-custom-libraries-on-the-cluster/m-p/7598#M3416</link>
      <description>&lt;P&gt;@Priya K​&amp;nbsp;: Glad that my suggestions are helping you! You could go ahead and mark both as the best answers &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; This works just fine.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 01:45:36 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/multiple-versions-of-custom-libraries-on-the-cluster/m-p/7598#M3416</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-07T01:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple versions of custom libraries on the cluster</title>
      <link>https://community.databricks.com/t5/data-engineering/multiple-versions-of-custom-libraries-on-the-cluster/m-p/151134#M53593</link>
      <description>&lt;P&gt;Why does databricks forum not filter out these spambot AI replies ?&amp;nbsp; If one wants an AI chatbot to guess an answer their question, they are free to directly ask ChatGPT, etc.&amp;nbsp; A community forum is for human-written answers based on actual first-hand knowledge.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2026 12:31:38 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/multiple-versions-of-custom-libraries-on-the-cluster/m-p/151134#M53593</guid>
      <dc:creator>bkapers</dc:creator>
      <dc:date>2026-03-17T12:31:38Z</dc:date>
    </item>
  </channel>
</rss>

