<?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: Import python file to notebook doesn't work in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/import-python-file-to-notebook-doesn-t-work/m-p/8150#M3861</link>
    <description>&lt;P&gt;Thank you so much for getting back to us @Jennifer MJ​&amp;nbsp;. It's really great of you to send in the solution. Would you be happy to mark the answer as best so other community members can find the solution quickly and easily?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We really appreciate your time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish you a great Databricks journey ahead!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 31 Mar 2023 08:49:47 GMT</pubDate>
    <dc:creator>Vartika</dc:creator>
    <dc:date>2023-03-31T08:49:47Z</dc:date>
    <item>
      <title>Import python file to notebook doesn't work</title>
      <link>https://community.databricks.com/t5/data-engineering/import-python-file-to-notebook-doesn-t-work/m-p/8146#M3857</link>
      <description>&lt;P&gt;I followed the documentation &lt;A href="https://docs.databricks.com/notebooks/share-code.html#reference-source-code-files-using-git" alt="https://docs.databricks.com/notebooks/share-code.html#reference-source-code-files-using-git" target="_blank"&gt;here &lt;/A&gt;under the section "Import a file into a notebook" to import a shared python file among notebooks used by delta live table. But it sometimes can find the module, sometimes not and returns me exception No module named '***'.&lt;/P&gt;&lt;P&gt;I wonder if this is a bug on Databricks.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 14:00:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/import-python-file-to-notebook-doesn-t-work/m-p/8146#M3857</guid>
      <dc:creator>Jennifer</dc:creator>
      <dc:date>2023-03-07T14:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: Import python file to notebook doesn't work</title>
      <link>https://community.databricks.com/t5/data-engineering/import-python-file-to-notebook-doesn-t-work/m-p/8148#M3859</link>
      <description>&lt;P&gt;Hey there @Jennifer MJ​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope everything is going great.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just wanted to check in if you were able to resolve your issue or do you need more help? We'd love to hear from you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 08:37:39 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/import-python-file-to-notebook-doesn-t-work/m-p/8148#M3859</guid>
      <dc:creator>Vartika</dc:creator>
      <dc:date>2023-03-31T08:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Import python file to notebook doesn't work</title>
      <link>https://community.databricks.com/t5/data-engineering/import-python-file-to-notebook-doesn-t-work/m-p/8149#M3860</link>
      <description>&lt;P&gt;It is still a problem when using DLT. But I put my functions in another notebook and schedule a job with multiple tasks, not using DLT anymore, then it works. I guess it might be a issue with DLT.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 08:41:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/import-python-file-to-notebook-doesn-t-work/m-p/8149#M3860</guid>
      <dc:creator>Jennifer</dc:creator>
      <dc:date>2023-03-31T08:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Import python file to notebook doesn't work</title>
      <link>https://community.databricks.com/t5/data-engineering/import-python-file-to-notebook-doesn-t-work/m-p/8150#M3861</link>
      <description>&lt;P&gt;Thank you so much for getting back to us @Jennifer MJ​&amp;nbsp;. It's really great of you to send in the solution. Would you be happy to mark the answer as best so other community members can find the solution quickly and easily?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We really appreciate your time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish you a great Databricks journey ahead!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 08:49:47 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/import-python-file-to-notebook-doesn-t-work/m-p/8150#M3861</guid>
      <dc:creator>Vartika</dc:creator>
      <dc:date>2023-03-31T08:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: Import python file to notebook doesn't work</title>
      <link>https://community.databricks.com/t5/data-engineering/import-python-file-to-notebook-doesn-t-work/m-p/8147#M3858</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Whenever you get the error, could you please try to list the file from DBFS in the notebook? Also, a screenshot would be helpful of the error code and the output.&lt;/P&gt;&lt;P&gt;Please let us know if this helps.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also please tag&amp;nbsp;&lt;A href="https://community.databricks.com/s/profile/0053f000000WWwvAAG" alt="https://community.databricks.com/s/profile/0053f000000WWwvAAG" target="_blank"&gt;@Debayan&lt;/A&gt;​&amp;nbsp;with your next response which will notify me, Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2023 06:40:36 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/import-python-file-to-notebook-doesn-t-work/m-p/8147#M3858</guid>
      <dc:creator>Debayan</dc:creator>
      <dc:date>2023-03-08T06:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: Import python file to notebook doesn't work</title>
      <link>https://community.databricks.com/t5/data-engineering/import-python-file-to-notebook-doesn-t-work/m-p/63097#M32171</link>
      <description>&lt;LI-CODE lang="markup"&gt;java.lang.RuntimeException: Failed to execute python command for notebook '/Repos/cflowers@trend.community/treNLP/src/pipeline' with id RunnableCommandId(5385449474169222390) and error AnsiResult(&amp;#27;[0;31m---------------------------------------------------------------------------&amp;#27;[0m
&amp;#27;[0;31mModuleNotFoundError&amp;#27;[0m                       Traceback (most recent call last)
File &amp;#27;[0;32m&amp;lt;command--1&amp;gt;:5&amp;#27;[0m
&amp;#27;[1;32m      3&amp;#27;[0m &amp;#27;[38;5;28;01mimport&amp;#27;[39;00m &amp;#27;[38;5;21;01mdlt&amp;#27;[39;00m
&amp;#27;[1;32m      4&amp;#27;[0m &amp;#27;[38;5;28;01mfrom&amp;#27;[39;00m &amp;#27;[38;5;21;01mpyspark&amp;#27;[39;00m&amp;#27;[38;5;21;01m.&amp;#27;[39;00m&amp;#27;[38;5;21;01msql&amp;#27;[39;00m &amp;#27;[38;5;28;01mimport&amp;#27;[39;00m SparkSession
&amp;#27;[0;32m----&amp;gt; 5&amp;#27;[0m &amp;#27;[38;5;28;01mfrom&amp;#27;[39;00m &amp;#27;[38;5;21;01mclients&amp;#27;[39;00m&amp;#27;[38;5;21;01m.&amp;#27;[39;00m&amp;#27;[38;5;21;01mpipeline_client&amp;#27;[39;00m &amp;#27;[38;5;28;01mimport&amp;#27;[39;00m DatabricksPipelineClient
&amp;#27;[1;32m      6&amp;#27;[0m &amp;#27;[38;5;28;01mfrom&amp;#27;[39;00m &amp;#27;[38;5;21;01mclients&amp;#27;[39;00m&amp;#27;[38;5;21;01m.&amp;#27;[39;00m&amp;#27;[38;5;21;01mTreNLPModel&amp;#27;[39;00m &amp;#27;[38;5;28;01mimport&amp;#27;[39;00m MLFlowModel
&amp;#27;[1;32m      7&amp;#27;[0m &amp;#27;[38;5;28;01mfrom&amp;#27;[39;00m &amp;#27;[38;5;21;01mclients&amp;#27;[39;00m&amp;#27;[38;5;21;01m.&amp;#27;[39;00m&amp;#27;[38;5;21;01mdatabricks_client&amp;#27;[39;00m &amp;#27;[38;5;28;01mimport&amp;#27;[39;00m DatabricksHttpClient

File &amp;#27;[0;32m/databricks/python_shell/dbruntime/PythonPackageImportsInstrumentation/__init__.py:171&amp;#27;[0m, in &amp;#27;[0;36m_create_import_patch.&amp;lt;locals&amp;gt;.import_patch&amp;#27;[0;34m(name, globals, locals, fromlist, level)&amp;#27;[0m
&amp;#27;[1;32m    166&amp;#27;[0m thread_local&amp;#27;[38;5;241m.&amp;#27;[39m_nest_level &amp;#27;[38;5;241m+&amp;#27;[39m&amp;#27;[38;5;241m=&amp;#27;[39m &amp;#27;[38;5;241m1&amp;#27;[39m
&amp;#27;[1;32m    168&amp;#27;[0m &amp;#27;[38;5;28;01mtry&amp;#27;[39;00m:
&amp;#27;[1;32m    169&amp;#27;[0m     &amp;#27;[38;5;66;03m# Import the desired module. If you’re seeing this while debugging a failed import,&amp;#27;[39;00m
&amp;#27;[1;32m    170&amp;#27;[0m     &amp;#27;[38;5;66;03m# look at preceding stack frames for relevant error information.&amp;#27;[39;00m
&amp;#27;[0;32m--&amp;gt; 171&amp;#27;[0m     original_result &amp;#27;[38;5;241m=&amp;#27;[39m &amp;#27;[43mpython_builtin_import&amp;#27;[49m&amp;#27;[43m(&amp;#27;[49m&amp;#27;[43mname&amp;#27;[49m&amp;#27;[43m,&amp;#27;[49m&amp;#27;[43m &amp;#27;[49m&amp;#27;[38;5;28;43mglobals&amp;#27;[39;49m&amp;#27;[43m,&amp;#27;[49m&amp;#27;[43m &amp;#27;[49m&amp;#27;[38;5;28;43mlocals&amp;#27;[39;49m&amp;#27;[43m,&amp;#27;[49m&amp;#27;[43m &amp;#27;[49m&amp;#27;[43mfromlist&amp;#27;[49m&amp;#27;[43m,&amp;#27;[49m&amp;#27;[43m &amp;#27;[49m&amp;#27;[43mlevel&amp;#27;[49m&amp;#27;[43m)&amp;#27;[49m
&amp;#27;[1;32m    173&amp;#27;[0m     is_root_import &amp;#27;[38;5;241m=&amp;#27;[39m thread_local&amp;#27;[38;5;241m.&amp;#27;[39m_nest_level &amp;#27;[38;5;241m==&amp;#27;[39m &amp;#27;[38;5;241m1&amp;#27;[39m
&amp;#27;[1;32m    174&amp;#27;[0m     &amp;#27;[38;5;66;03m# `level` represents the number of leading dots in a relative import statement.&amp;#27;[39;00m
&amp;#27;[1;32m    175&amp;#27;[0m     &amp;#27;[38;5;66;03m# If it's zero, then this is an absolute import.&amp;#27;[39;00m

&amp;#27;[0;31mModuleNotFoundError&amp;#27;[0m: No module named 'clients',None,Map(),Map(),List(),List(),Map())&lt;/LI-CODE&gt;&lt;P&gt;I actually don't think the accepted solution should be accepted as the problem involving DLT was not addressed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having a similar issue while trying to import from repos in a DLT pipeline.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2024 21:19:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/import-python-file-to-notebook-doesn-t-work/m-p/63097#M32171</guid>
      <dc:creator>coltonflowers</dc:creator>
      <dc:date>2024-03-08T21:19:10Z</dc:date>
    </item>
  </channel>
</rss>

