<?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: ModuleNotFoundError: No module named 'pyspark.dbutils' in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/modulenotfounderror-no-module-named-pyspark-dbutils/m-p/52469#M29441</link>
    <description>&lt;P&gt;We are trying to do similar thing . we are using dbutils to get secret scope and we doing unittesting in azure pipeline where it gives error pyspark.dbutils not found&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have tried using databricks.sdk.dbutils for which I got authentication error li kr value not found I used databricks -connect library as well but still the same issue..&lt;/P&gt;&lt;P&gt;Can you please help with it?&lt;/P&gt;</description>
    <pubDate>Fri, 17 Nov 2023 00:43:23 GMT</pubDate>
    <dc:creator>Poonam_Joshi</dc:creator>
    <dc:date>2023-11-17T00:43:23Z</dc:date>
    <item>
      <title>ModuleNotFoundError: No module named 'pyspark.dbutils'</title>
      <link>https://community.databricks.com/t5/data-engineering/modulenotfounderror-no-module-named-pyspark-dbutils/m-p/46215#M28014</link>
      <description>&lt;P&gt;I have a class in a python file like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from pyspark.sql import SparkSession
from pyspark.dbutils import DBUtils
 class DatabricksUtils:

      def __init__(self‌‌):
        self.spark = SparkSession.getActiveSession()
        self.dbutils = DBUtils(self.spark)
     
     def get_dbutils(self) -&amp;gt; DBUtils:
        return self.dbutils&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;In another python file, I am importing this module and calling the db utils like&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;from .myProject.functions.utils import *&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; db&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; DatabricksUtils()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;dbutils &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; db.get_dbutils()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This works when I test it locally in vscode but in Azure Pipeline when I try to build my unit tests fail and I get a message&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ModuleNotFoundError: No module named 'pyspark.dbutils'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 25 Sep 2023 22:23:22 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/modulenotfounderror-no-module-named-pyspark-dbutils/m-p/46215#M28014</guid>
      <dc:creator>vk217</dc:creator>
      <dc:date>2023-09-25T22:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: ModuleNotFoundError: No module named 'pyspark.dbutils'</title>
      <link>https://community.databricks.com/t5/data-engineering/modulenotfounderror-no-module-named-pyspark-dbutils/m-p/46642#M28078</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/71250"&gt;@vk217&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;What Databricks runtime version was the cluster you ran the code on? I was able to successfully run your code in a 12.2 and a 13.3 cluster.&lt;/P&gt;
&lt;P&gt;Can you try running it on a cluster with one of those DBR versions, if you haven't already? And please let us know if you're still running into issues.&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;Miguel&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 18:58:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/modulenotfounderror-no-module-named-pyspark-dbutils/m-p/46642#M28078</guid>
      <dc:creator>Miguel_Suarez</dc:creator>
      <dc:date>2023-09-28T18:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: ModuleNotFoundError: No module named 'pyspark.dbutils'</title>
      <link>https://community.databricks.com/t5/data-engineering/modulenotfounderror-no-module-named-pyspark-dbutils/m-p/52469#M29441</link>
      <description>&lt;P&gt;We are trying to do similar thing . we are using dbutils to get secret scope and we doing unittesting in azure pipeline where it gives error pyspark.dbutils not found&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have tried using databricks.sdk.dbutils for which I got authentication error li kr value not found I used databricks -connect library as well but still the same issue..&lt;/P&gt;&lt;P&gt;Can you please help with it?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2023 00:43:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/modulenotfounderror-no-module-named-pyspark-dbutils/m-p/52469#M29441</guid>
      <dc:creator>Poonam_Joshi</dc:creator>
      <dc:date>2023-11-17T00:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: ModuleNotFoundError: No module named 'pyspark.dbutils'</title>
      <link>https://community.databricks.com/t5/data-engineering/modulenotfounderror-no-module-named-pyspark-dbutils/m-p/71066#M34240</link>
      <description>&lt;P&gt;Hi, we are also in the same exact situation. Were you able to solve the problem? Or a workaround maybe.&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 03:35:33 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/modulenotfounderror-no-module-named-pyspark-dbutils/m-p/71066#M34240</guid>
      <dc:creator>Jarkrung</dc:creator>
      <dc:date>2024-05-30T03:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: ModuleNotFoundError: No module named 'pyspark.dbutils'</title>
      <link>https://community.databricks.com/t5/data-engineering/modulenotfounderror-no-module-named-pyspark-dbutils/m-p/111258#M43833</link>
      <description>&lt;P&gt;Had the same Problem in my GitLab CI/CD Pipeline while trying to deploy:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$ databricks bundle deploy -t dev
Building package...
Error: build failed package, error: exit status 1, output: Traceback (most recent call last):
  [...]
  File "/builds/user/package/./src/package/main.py", line 2, in &amp;lt;module&amp;gt;
    from pyspark.dbutils import DBUtils
ModuleNotFoundError: No module named 'pyspark.dbutils'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Solved it by completing the&lt;STRONG&gt; requirements.txt&lt;/STRONG&gt; with&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;ipykernel&amp;gt;=6.29.4&lt;/LI&gt;&lt;LI&gt;nbformat&amp;gt;=5.10.4&lt;/LI&gt;&lt;LI&gt;databricks-connect&amp;gt;=13.1.0&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;as seen here: &lt;A href="https://github.com/databricks/dais-cow-bff/blob/dais24-main/requirements.txt" target="_blank" rel="noopener"&gt;https://github.com/databricks/dais-cow-bff/blob/dais24-main/requirements.txt&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2025 12:27:08 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/modulenotfounderror-no-module-named-pyspark-dbutils/m-p/111258#M43833</guid>
      <dc:creator>T0M</dc:creator>
      <dc:date>2025-02-26T12:27:08Z</dc:date>
    </item>
  </channel>
</rss>

