<?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: custom python module not found while using dbx on pycharm in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/custom-python-module-not-found-while-using-dbx-on-pycharm/m-p/17393#M11420</link>
    <description>&lt;P&gt;Even I got error​&lt;/P&gt;</description>
    <pubDate>Mon, 06 Feb 2023 10:33:30 GMT</pubDate>
    <dc:creator>Meghala</dc:creator>
    <dc:date>2023-02-06T10:33:30Z</dc:date>
    <item>
      <title>custom python module not found while using dbx on pycharm</title>
      <link>https://community.databricks.com/t5/data-engineering/custom-python-module-not-found-while-using-dbx-on-pycharm/m-p/17389#M11416</link>
      <description>&lt;P&gt;Am new to databricks and pyspark. Building a pyspark application using pycharm IDE. I have tested the code in local and wanted to run on databricks cluster from IDE itself. Following the dbx documentation and able to run the single python file successfully. However, I have some custom python modules developed and calling some functions from those modules in the main python file. Am getting module not found error in this case. Could anyone please assist me here ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is my python project structure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Databricks&lt;/P&gt;&lt;P&gt; apps&lt;/P&gt;&lt;P&gt; &lt;A href="https://test.py" alt="https://test.py" target="_blank"&gt;test.py&lt;/A&gt;&lt;/P&gt;&lt;P&gt; __init__.py&lt;/P&gt;&lt;P&gt; utils&lt;/P&gt;&lt;P&gt; GenericUtils&lt;A href="https://sqlutils.py" alt="https://sqlutils.py" target="_blank"&gt;.py&lt;/A&gt;&lt;/P&gt;&lt;P&gt; __init__.py&lt;/P&gt;&lt;P&gt; __init__.py&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am importing GenericUtils into my main python file which is &lt;A href="https://test.py" alt="https://test.py" target="_blank"&gt;test.py&lt;/A&gt; and below is the error&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#############################################&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Running the entrypoint file[dbx][2022-12-11 21:23:08.580] Execution failed, please follow the given error&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;ModuleNotFoundError&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Traceback (most recent call last)&lt;/P&gt;&lt;P&gt;&amp;lt;command--1&amp;gt; in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;1 from pyspark.sql import SparkSession&lt;/P&gt;&lt;P&gt;----&amp;gt; 2 import databricks.utils.GenericUtils as GenUt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;4 spark = SparkSession \&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;5&amp;nbsp;&amp;nbsp;&amp;nbsp;.builder \&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/databricks/python_shell/dbruntime/PythonPackageImportsInstrumentation/__init__.py in import_patch(name, globals, locals, fromlist, level)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;165&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# Import the desired module. If you’re seeing this while debugging a failed import,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;166&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# look at preceding stack frames for relevant error information.&lt;/P&gt;&lt;P&gt;--&amp;gt; 167&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;original_result = python_builtin_import(name, globals, locals, fromlist, level)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;168&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;169&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;is_root_import = thread_local._nest_level == 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ModuleNotFoundError: No module named 'databricks.utils'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#############################################&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the deployment.yaml&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;build:&lt;/P&gt;&lt;P&gt;&lt;I&gt; &lt;/I&gt;no_build: true&lt;/P&gt;&lt;P&gt;environments:&lt;/P&gt;&lt;P&gt; default:&lt;/P&gt;&lt;P&gt; workflows:&lt;/P&gt;&lt;P&gt; - name: "dbx-demo-job"&lt;/P&gt;&lt;P&gt; spark_python_task:&lt;/P&gt;&lt;P&gt; python_file: "file://src/databricks/apps/t&lt;A href="https://DBTest.py" alt="https://DBTest.py" target="_blank"&gt;est.py&lt;/A&gt;"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the dbx command used&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dbx execute --cluster-id &amp;lt;cluster_id&amp;gt; dbx-demo-job --no-package --debug&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Dec 2022 16:07:54 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/custom-python-module-not-found-while-using-dbx-on-pycharm/m-p/17389#M11416</guid>
      <dc:creator>sasidhar</dc:creator>
      <dc:date>2022-12-11T16:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: custom python module not found while using dbx on pycharm</title>
      <link>https://community.databricks.com/t5/data-engineering/custom-python-module-not-found-while-using-dbx-on-pycharm/m-p/17390#M11417</link>
      <description>&lt;P&gt;@Sasidhar Reddy​&amp;nbsp; it is working for me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1021i5D2206A78C48B4C1/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you like or get any hint from my answer please upvote it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Aviral Bhardwaj&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2022 14:51:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/custom-python-module-not-found-while-using-dbx-on-pycharm/m-p/17390#M11417</guid>
      <dc:creator>Aviral-Bhardwaj</dc:creator>
      <dc:date>2022-12-16T14:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: custom python module not found while using dbx on pycharm</title>
      <link>https://community.databricks.com/t5/data-engineering/custom-python-module-not-found-while-using-dbx-on-pycharm/m-p/17391#M11418</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;A href="https://community.databricks.com/s/profile/0058Y00000BzrW2QAJ" alt="https://community.databricks.com/s/profile/0058Y00000BzrW2QAJ" target="_blank"&gt;sasidhar&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you able to solve the "&lt;B&gt;module not found" error&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Prakasam.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2023 08:59:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/custom-python-module-not-found-while-using-dbx-on-pycharm/m-p/17391#M11418</guid>
      <dc:creator>Prakasam</dc:creator>
      <dc:date>2023-01-31T08:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: custom python module not found while using dbx on pycharm</title>
      <link>https://community.databricks.com/t5/data-engineering/custom-python-module-not-found-while-using-dbx-on-pycharm/m-p/17392#M11419</link>
      <description>&lt;P&gt;it works for me too and didnt face the "module not found" error.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 11:45:46 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/custom-python-module-not-found-while-using-dbx-on-pycharm/m-p/17392#M11419</guid>
      <dc:creator>Rajeev_Basu</dc:creator>
      <dc:date>2023-02-03T11:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: custom python module not found while using dbx on pycharm</title>
      <link>https://community.databricks.com/t5/data-engineering/custom-python-module-not-found-while-using-dbx-on-pycharm/m-p/17393#M11420</link>
      <description>&lt;P&gt;Even I got error​&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 10:33:30 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/custom-python-module-not-found-while-using-dbx-on-pycharm/m-p/17393#M11420</guid>
      <dc:creator>Meghala</dc:creator>
      <dc:date>2023-02-06T10:33:30Z</dc:date>
    </item>
  </channel>
</rss>

