<?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: Cannot import editable installed module in notebook in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/cannot-import-editable-installed-module-in-notebook/m-p/135876#M10898</link>
    <description>&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;This issue happens because Jupyter uses a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;different Python environment&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;from the one where you installed&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;mypkg&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in editable mode. Although running&lt;BR /&gt;&lt;CODE&gt;%pip install -e /path/to/mypkg&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;inside the notebook prints a success message, that command may run in a separate interpreter than the one your active notebook kernel uses.&lt;/P&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;When you later execute&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;!python -m mypkg.module&lt;/CODE&gt;, it works only because&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;!python&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;launches an external process that uses your system or virtualenv Python — not the running Jupyter kernel’s Python session.​&lt;/P&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;Confirm what’s happening&lt;/H2&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;To verify the mismatch:&lt;/P&gt;
&lt;DIV class="w-full md:max-w-[90vw]"&gt;
&lt;DIV class="codeWrapper text-light selection:text-super selection:bg-super/10 my-md relative flex flex-col rounded font-mono text-sm font-normal bg-subtler"&gt;
&lt;DIV class="translate-y-xs -translate-x-xs bottom-xl mb-xl flex h-0 items-start justify-end md:sticky md:top-[100px]"&gt;
&lt;DIV class="overflow-hidden rounded-full border-subtlest ring-subtlest divide-subtlest bg-base"&gt;
&lt;DIV class="border-subtlest ring-subtlest divide-subtlest bg-subtler"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="-mt-xl"&gt;
&lt;DIV&gt;
&lt;DIV class="text-quiet bg-subtle py-xs px-sm inline-block rounded-br rounded-tl-[3px] font-thin" data-testid="code-language-indicator"&gt;python&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;CODE&gt;&lt;SPAN class="token token"&gt;import&lt;/SPAN&gt; sys
&lt;SPAN class="token token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="token token punctuation"&gt;(&lt;/SPAN&gt;sys&lt;SPAN class="token token punctuation"&gt;.&lt;/SPAN&gt;executable&lt;SPAN class="token token punctuation"&gt;)&lt;/SPAN&gt;
!which python
!jupyter kernelspec &lt;SPAN class="token token"&gt;list&lt;/SPAN&gt;
&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;If these point to different paths, that’s the cause of your&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;ModuleNotFoundError&lt;/CODE&gt;.&lt;/P&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;Solutions&lt;/H2&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;1. Ensure your notebook kernel uses the same environment&lt;/H2&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Activate the same environment you used for the editable install and register it as a Jupyter kernel:&lt;/P&gt;
&lt;DIV class="w-full md:max-w-[90vw]"&gt;
&lt;DIV class="codeWrapper text-light selection:text-super selection:bg-super/10 my-md relative flex flex-col rounded font-mono text-sm font-normal bg-subtler"&gt;
&lt;DIV class="translate-y-xs -translate-x-xs bottom-xl mb-xl flex h-0 items-start justify-end md:sticky md:top-[100px]"&gt;
&lt;DIV class="overflow-hidden rounded-full border-subtlest ring-subtlest divide-subtlest bg-base"&gt;
&lt;DIV class="border-subtlest ring-subtlest divide-subtlest bg-subtler"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="-mt-xl"&gt;
&lt;DIV&gt;
&lt;DIV class="text-quiet bg-subtle py-xs px-sm inline-block rounded-br rounded-tl-[3px] font-thin" data-testid="code-language-indicator"&gt;bash&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;CODE&gt;&lt;SPAN class="token token"&gt;source&lt;/SPAN&gt; /path/to/venv/bin/activate
pip &lt;SPAN class="token token"&gt;install&lt;/SPAN&gt; ipykernel
python -m ipykernel &lt;SPAN class="token token"&gt;install&lt;/SPAN&gt; --user --name mypkg-env --display-name &lt;SPAN class="token token"&gt;"mypkg env"&lt;/SPAN&gt;
&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Then reopen your notebook and select “mypkg env” from the kernel list.​&lt;/P&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;2. Verify installation path&lt;/H2&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;In a notebook cell, print out:&lt;/P&gt;
&lt;DIV class="w-full md:max-w-[90vw]"&gt;
&lt;DIV class="codeWrapper text-light selection:text-super selection:bg-super/10 my-md relative flex flex-col rounded font-mono text-sm font-normal bg-subtler"&gt;
&lt;DIV class="translate-y-xs -translate-x-xs bottom-xl mb-xl flex h-0 items-start justify-end md:sticky md:top-[100px]"&gt;
&lt;DIV class="overflow-hidden rounded-full border-subtlest ring-subtlest divide-subtlest bg-base"&gt;
&lt;DIV class="border-subtlest ring-subtlest divide-subtlest bg-subtler"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="-mt-xl"&gt;
&lt;DIV&gt;
&lt;DIV class="text-quiet bg-subtle py-xs px-sm inline-block rounded-br rounded-tl-[3px] font-thin" data-testid="code-language-indicator"&gt;python&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;CODE&gt;&lt;SPAN class="token token"&gt;import&lt;/SPAN&gt; site
site&lt;SPAN class="token token punctuation"&gt;.&lt;/SPAN&gt;getsitepackages&lt;SPAN class="token token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token token punctuation"&gt;)&lt;/SPAN&gt;
&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Check that the editable-path&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;.egg-link&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;file for&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;mypkg&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is in one of these directories.&lt;/P&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;3. As a fallback, add it to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;sys.path&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;manually&lt;/H2&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;If switching kernels is not possible, append the install location:&lt;/P&gt;
&lt;DIV class="w-full md:max-w-[90vw]"&gt;
&lt;DIV class="codeWrapper text-light selection:text-super selection:bg-super/10 my-md relative flex flex-col rounded font-mono text-sm font-normal bg-subtler"&gt;
&lt;DIV class="translate-y-xs -translate-x-xs bottom-xl mb-xl flex h-0 items-start justify-end md:sticky md:top-[100px]"&gt;
&lt;DIV class="overflow-hidden rounded-full border-subtlest ring-subtlest divide-subtlest bg-base"&gt;
&lt;DIV class="border-subtlest ring-subtlest divide-subtlest bg-subtler"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="-mt-xl"&gt;
&lt;DIV&gt;
&lt;DIV class="text-quiet bg-subtle py-xs px-sm inline-block rounded-br rounded-tl-[3px] font-thin" data-testid="code-language-indicator"&gt;python&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;CODE&gt;&lt;SPAN class="token token"&gt;import&lt;/SPAN&gt; sys
sys&lt;SPAN class="token token punctuation"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="token token punctuation"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="token token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token token"&gt;"/path/to/mypkg"&lt;/SPAN&gt;&lt;SPAN class="token token punctuation"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="token token"&gt;import&lt;/SPAN&gt; mypkg&lt;SPAN class="token token punctuation"&gt;.&lt;/SPAN&gt;module
&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;This mirrors what happens automatically in the terminal’s&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;sys.path&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;but not in Jupyter’s environment.​&lt;/P&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;4. Optionally reinstall inside the notebook’s environment&lt;/H2&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;If you confirm that the notebook uses a different environment (e.g., Conda base or system Python), reinstall&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;mypkg&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;inside it:&lt;/P&gt;
&lt;DIV class="w-full md:max-w-[90vw]"&gt;
&lt;DIV class="codeWrapper text-light selection:text-super selection:bg-super/10 my-md relative flex flex-col rounded font-mono text-sm font-normal bg-subtler"&gt;
&lt;DIV class="translate-y-xs -translate-x-xs bottom-xl mb-xl flex h-0 items-start justify-end md:sticky md:top-[100px]"&gt;
&lt;DIV class="overflow-hidden rounded-full border-subtlest ring-subtlest divide-subtlest bg-base"&gt;
&lt;DIV class="border-subtlest ring-subtlest divide-subtlest bg-subtler"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="-mt-xl"&gt;
&lt;DIV&gt;
&lt;DIV class="text-quiet bg-subtle py-xs px-sm inline-block rounded-br rounded-tl-[3px] font-thin" data-testid="code-language-indicator"&gt;python&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;CODE&gt;&lt;SPAN class="token token operator"&gt;%&lt;/SPAN&gt;pip install &lt;SPAN class="token token operator"&gt;-&lt;/SPAN&gt;e &lt;SPAN class="token token operator"&gt;/&lt;/SPAN&gt;path&lt;SPAN class="token token operator"&gt;/&lt;/SPAN&gt;to&lt;SPAN class="token token operator"&gt;/&lt;/SPAN&gt;mypkg &lt;SPAN class="token token operator"&gt;-&lt;/SPAN&gt;&lt;SPAN class="token token operator"&gt;-&lt;/SPAN&gt;force&lt;SPAN class="token token operator"&gt;-&lt;/SPAN&gt;reinstall
&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Once the kernel and Jupyter runtime point to the same Python interpreter where the editable installation resides,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;import mypkg.module&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;will succeed consistently.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Oct 2025 17:50:55 GMT</pubDate>
    <dc:creator>mark_ott</dc:creator>
    <dc:date>2025-10-23T17:50:55Z</dc:date>
    <item>
      <title>Cannot import editable installed module in notebook</title>
      <link>https://community.databricks.com/t5/get-started-discussions/cannot-import-editable-installed-module-in-notebook/m-p/118759#M10009</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have the following directory structure:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;- mypkg/
  - setup.py
  - mypkg/
    - __init__.py
    - module.py
- scripts/
  - main # notebook
  &lt;/LI-CODE&gt;&lt;P&gt;From the `main` notebok I have a cell that runs:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;%pip install -e /path/to/mypkg&lt;/LI-CODE&gt;&lt;P&gt;This command appears to successfully install the package. And in a subsequent cell I can run:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;!python -m mypkg.module&lt;/LI-CODE&gt;&lt;P&gt;and it executes successfully.&lt;/P&gt;&lt;P&gt;However, when I try in a notebook cell to simply run:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;import mypkg.module&lt;/LI-CODE&gt;&lt;P&gt;the execution fails with the message:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ModuleNotFoundError: No module named 'mypkg'&lt;/LI-CODE&gt;&lt;P&gt;I've tried executing the import both before and after running `%restart_python` and it fails either way.&lt;/P&gt;&lt;P&gt;Please advise.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Sat, 10 May 2025 14:10:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/cannot-import-editable-installed-module-in-notebook/m-p/118759#M10009</guid>
      <dc:creator>newenglander</dc:creator>
      <dc:date>2025-05-10T14:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot import editable installed module in notebook</title>
      <link>https://community.databricks.com/t5/get-started-discussions/cannot-import-editable-installed-module-in-notebook/m-p/135858#M10897</link>
      <description>&lt;P class="p1"&gt;Hey &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/164018"&gt;@newenglander&lt;/a&gt; — always great to meet a fellow New Englander &lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;
&lt;P class="p1"&gt;Could you share a bit more detail about your setup? For example, are you running on &lt;SPAN class="s2"&gt;&lt;STRONG&gt;classic compute&lt;/STRONG&gt;&lt;/SPAN&gt; or &lt;SPAN class="s2"&gt;&lt;STRONG&gt;serverless&lt;/STRONG&gt;&lt;/SPAN&gt;? And are you working in a &lt;SPAN class="s2"&gt;&lt;STRONG&gt;customer workspace&lt;/STRONG&gt;&lt;/SPAN&gt;, or using &lt;SPAN class="s2"&gt;&lt;STRONG&gt;Databricks Free Edition&lt;/STRONG&gt;&lt;/SPAN&gt; (formerly Community Edition)?&lt;/P&gt;
&lt;P class="p1"&gt;Any additional context you can provide will help me point you in the right direction.&lt;/P&gt;
&lt;P class="p1"&gt;Cheers, Louis.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Oct 2025 15:11:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/cannot-import-editable-installed-module-in-notebook/m-p/135858#M10897</guid>
      <dc:creator>Louis_Frolio</dc:creator>
      <dc:date>2025-10-23T15:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot import editable installed module in notebook</title>
      <link>https://community.databricks.com/t5/get-started-discussions/cannot-import-editable-installed-module-in-notebook/m-p/135876#M10898</link>
      <description>&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;This issue happens because Jupyter uses a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;different Python environment&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;from the one where you installed&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;mypkg&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in editable mode. Although running&lt;BR /&gt;&lt;CODE&gt;%pip install -e /path/to/mypkg&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;inside the notebook prints a success message, that command may run in a separate interpreter than the one your active notebook kernel uses.&lt;/P&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;When you later execute&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;!python -m mypkg.module&lt;/CODE&gt;, it works only because&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;!python&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;launches an external process that uses your system or virtualenv Python — not the running Jupyter kernel’s Python session.​&lt;/P&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;Confirm what’s happening&lt;/H2&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;To verify the mismatch:&lt;/P&gt;
&lt;DIV class="w-full md:max-w-[90vw]"&gt;
&lt;DIV class="codeWrapper text-light selection:text-super selection:bg-super/10 my-md relative flex flex-col rounded font-mono text-sm font-normal bg-subtler"&gt;
&lt;DIV class="translate-y-xs -translate-x-xs bottom-xl mb-xl flex h-0 items-start justify-end md:sticky md:top-[100px]"&gt;
&lt;DIV class="overflow-hidden rounded-full border-subtlest ring-subtlest divide-subtlest bg-base"&gt;
&lt;DIV class="border-subtlest ring-subtlest divide-subtlest bg-subtler"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="-mt-xl"&gt;
&lt;DIV&gt;
&lt;DIV class="text-quiet bg-subtle py-xs px-sm inline-block rounded-br rounded-tl-[3px] font-thin" data-testid="code-language-indicator"&gt;python&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;CODE&gt;&lt;SPAN class="token token"&gt;import&lt;/SPAN&gt; sys
&lt;SPAN class="token token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="token token punctuation"&gt;(&lt;/SPAN&gt;sys&lt;SPAN class="token token punctuation"&gt;.&lt;/SPAN&gt;executable&lt;SPAN class="token token punctuation"&gt;)&lt;/SPAN&gt;
!which python
!jupyter kernelspec &lt;SPAN class="token token"&gt;list&lt;/SPAN&gt;
&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;If these point to different paths, that’s the cause of your&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;ModuleNotFoundError&lt;/CODE&gt;.&lt;/P&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;Solutions&lt;/H2&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;1. Ensure your notebook kernel uses the same environment&lt;/H2&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Activate the same environment you used for the editable install and register it as a Jupyter kernel:&lt;/P&gt;
&lt;DIV class="w-full md:max-w-[90vw]"&gt;
&lt;DIV class="codeWrapper text-light selection:text-super selection:bg-super/10 my-md relative flex flex-col rounded font-mono text-sm font-normal bg-subtler"&gt;
&lt;DIV class="translate-y-xs -translate-x-xs bottom-xl mb-xl flex h-0 items-start justify-end md:sticky md:top-[100px]"&gt;
&lt;DIV class="overflow-hidden rounded-full border-subtlest ring-subtlest divide-subtlest bg-base"&gt;
&lt;DIV class="border-subtlest ring-subtlest divide-subtlest bg-subtler"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="-mt-xl"&gt;
&lt;DIV&gt;
&lt;DIV class="text-quiet bg-subtle py-xs px-sm inline-block rounded-br rounded-tl-[3px] font-thin" data-testid="code-language-indicator"&gt;bash&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;CODE&gt;&lt;SPAN class="token token"&gt;source&lt;/SPAN&gt; /path/to/venv/bin/activate
pip &lt;SPAN class="token token"&gt;install&lt;/SPAN&gt; ipykernel
python -m ipykernel &lt;SPAN class="token token"&gt;install&lt;/SPAN&gt; --user --name mypkg-env --display-name &lt;SPAN class="token token"&gt;"mypkg env"&lt;/SPAN&gt;
&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Then reopen your notebook and select “mypkg env” from the kernel list.​&lt;/P&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;2. Verify installation path&lt;/H2&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;In a notebook cell, print out:&lt;/P&gt;
&lt;DIV class="w-full md:max-w-[90vw]"&gt;
&lt;DIV class="codeWrapper text-light selection:text-super selection:bg-super/10 my-md relative flex flex-col rounded font-mono text-sm font-normal bg-subtler"&gt;
&lt;DIV class="translate-y-xs -translate-x-xs bottom-xl mb-xl flex h-0 items-start justify-end md:sticky md:top-[100px]"&gt;
&lt;DIV class="overflow-hidden rounded-full border-subtlest ring-subtlest divide-subtlest bg-base"&gt;
&lt;DIV class="border-subtlest ring-subtlest divide-subtlest bg-subtler"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="-mt-xl"&gt;
&lt;DIV&gt;
&lt;DIV class="text-quiet bg-subtle py-xs px-sm inline-block rounded-br rounded-tl-[3px] font-thin" data-testid="code-language-indicator"&gt;python&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;CODE&gt;&lt;SPAN class="token token"&gt;import&lt;/SPAN&gt; site
site&lt;SPAN class="token token punctuation"&gt;.&lt;/SPAN&gt;getsitepackages&lt;SPAN class="token token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token token punctuation"&gt;)&lt;/SPAN&gt;
&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Check that the editable-path&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;.egg-link&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;file for&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;mypkg&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is in one of these directories.&lt;/P&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;3. As a fallback, add it to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;sys.path&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;manually&lt;/H2&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;If switching kernels is not possible, append the install location:&lt;/P&gt;
&lt;DIV class="w-full md:max-w-[90vw]"&gt;
&lt;DIV class="codeWrapper text-light selection:text-super selection:bg-super/10 my-md relative flex flex-col rounded font-mono text-sm font-normal bg-subtler"&gt;
&lt;DIV class="translate-y-xs -translate-x-xs bottom-xl mb-xl flex h-0 items-start justify-end md:sticky md:top-[100px]"&gt;
&lt;DIV class="overflow-hidden rounded-full border-subtlest ring-subtlest divide-subtlest bg-base"&gt;
&lt;DIV class="border-subtlest ring-subtlest divide-subtlest bg-subtler"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="-mt-xl"&gt;
&lt;DIV&gt;
&lt;DIV class="text-quiet bg-subtle py-xs px-sm inline-block rounded-br rounded-tl-[3px] font-thin" data-testid="code-language-indicator"&gt;python&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;CODE&gt;&lt;SPAN class="token token"&gt;import&lt;/SPAN&gt; sys
sys&lt;SPAN class="token token punctuation"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="token token punctuation"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="token token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token token"&gt;"/path/to/mypkg"&lt;/SPAN&gt;&lt;SPAN class="token token punctuation"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="token token"&gt;import&lt;/SPAN&gt; mypkg&lt;SPAN class="token token punctuation"&gt;.&lt;/SPAN&gt;module
&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;This mirrors what happens automatically in the terminal’s&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;sys.path&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;but not in Jupyter’s environment.​&lt;/P&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;4. Optionally reinstall inside the notebook’s environment&lt;/H2&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;If you confirm that the notebook uses a different environment (e.g., Conda base or system Python), reinstall&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;mypkg&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;inside it:&lt;/P&gt;
&lt;DIV class="w-full md:max-w-[90vw]"&gt;
&lt;DIV class="codeWrapper text-light selection:text-super selection:bg-super/10 my-md relative flex flex-col rounded font-mono text-sm font-normal bg-subtler"&gt;
&lt;DIV class="translate-y-xs -translate-x-xs bottom-xl mb-xl flex h-0 items-start justify-end md:sticky md:top-[100px]"&gt;
&lt;DIV class="overflow-hidden rounded-full border-subtlest ring-subtlest divide-subtlest bg-base"&gt;
&lt;DIV class="border-subtlest ring-subtlest divide-subtlest bg-subtler"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="-mt-xl"&gt;
&lt;DIV&gt;
&lt;DIV class="text-quiet bg-subtle py-xs px-sm inline-block rounded-br rounded-tl-[3px] font-thin" data-testid="code-language-indicator"&gt;python&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;CODE&gt;&lt;SPAN class="token token operator"&gt;%&lt;/SPAN&gt;pip install &lt;SPAN class="token token operator"&gt;-&lt;/SPAN&gt;e &lt;SPAN class="token token operator"&gt;/&lt;/SPAN&gt;path&lt;SPAN class="token token operator"&gt;/&lt;/SPAN&gt;to&lt;SPAN class="token token operator"&gt;/&lt;/SPAN&gt;mypkg &lt;SPAN class="token token operator"&gt;-&lt;/SPAN&gt;&lt;SPAN class="token token operator"&gt;-&lt;/SPAN&gt;force&lt;SPAN class="token token operator"&gt;-&lt;/SPAN&gt;reinstall
&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Once the kernel and Jupyter runtime point to the same Python interpreter where the editable installation resides,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;import mypkg.module&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;will succeed consistently.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Oct 2025 17:50:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/cannot-import-editable-installed-module-in-notebook/m-p/135876#M10898</guid>
      <dc:creator>mark_ott</dc:creator>
      <dc:date>2025-10-23T17:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot import editable installed module in notebook</title>
      <link>https://community.databricks.com/t5/get-started-discussions/cannot-import-editable-installed-module-in-notebook/m-p/144814#M11329</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/82205"&gt;@mark_ott&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/34815"&gt;@Louis_Frolio&lt;/a&gt;&amp;nbsp;&amp;nbsp;thanks for the responses.&lt;/P&gt;&lt;P&gt;Louis -- I am using classic compute on a customer workspace. If it matters I am on DBR 15.4 ML.&lt;/P&gt;&lt;P&gt;Matt -- It appears to be as you said, that Jupyter is using a different python environment.&lt;/P&gt;&lt;P&gt;`sys.executable` and `!which python` both point to the same location: `/local_disk0/.ephemeral_nfs/envs/pythonEnv-&amp;lt;random string&amp;gt;/bin/python. But `!jupyter kernlespec list` returns:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Available kernels: python3 /databricks/python3/share/jupyter/kernels/python3&lt;/LI-CODE&gt;&lt;P&gt;However, running the command:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;!source activate pip install ipykernel python -m ipykernel install --user --name mypkg --display-name "mypkg"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;does not make my local project available as a package.&lt;/P&gt;&lt;P&gt;Is there any other command I can try? Especially any solution that makes my current project available more broadly across all executable programs within my project? I'd prefer not to have to adjust on a script-by-script or notebook-by-notebook basis (which is also a downside of the `sys.path.append` solution), but this is effectively what I'm doing rihgt now due to a lack of alternatives.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jan 2026 20:27:35 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/cannot-import-editable-installed-module-in-notebook/m-p/144814#M11329</guid>
      <dc:creator>newenglander</dc:creator>
      <dc:date>2026-01-21T20:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot import editable installed module in notebook</title>
      <link>https://community.databricks.com/t5/get-started-discussions/cannot-import-editable-installed-module-in-notebook/m-p/148369#M11429</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/164018"&gt;@newenglander&lt;/a&gt;&amp;nbsp;did you ever find a solution? I'm have a similar issue although mine is that I was doing the install from an init script that gets used by the cluster on start up. I have similar findings with the jupyter kernel being the odd one out.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Feb 2026 19:36:49 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/cannot-import-editable-installed-module-in-notebook/m-p/148369#M11429</guid>
      <dc:creator>kenmyers-8451</dc:creator>
      <dc:date>2026-02-13T19:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot import editable installed module in notebook</title>
      <link>https://community.databricks.com/t5/get-started-discussions/cannot-import-editable-installed-module-in-notebook/m-p/148370#M11430</link>
      <description>&lt;P&gt;actually, I think I just got mine working, the solution was to make it not editable (remove -e) and it seems to work now&lt;/P&gt;</description>
      <pubDate>Fri, 13 Feb 2026 19:41:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/cannot-import-editable-installed-module-in-notebook/m-p/148370#M11430</guid>
      <dc:creator>kenmyers-8451</dc:creator>
      <dc:date>2026-02-13T19:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot import editable installed module in notebook</title>
      <link>https://community.databricks.com/t5/get-started-discussions/cannot-import-editable-installed-module-in-notebook/m-p/148374#M11431</link>
      <description>&lt;P&gt;Sorry to triple post but I have another update: it seems to work for standalone clusters, but it refuses to build the wheel (I get a write permission error) on the job clusters.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Feb 2026 20:49:38 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/cannot-import-editable-installed-module-in-notebook/m-p/148374#M11431</guid>
      <dc:creator>kenmyers-8451</dc:creator>
      <dc:date>2026-02-13T20:49:38Z</dc:date>
    </item>
  </channel>
</rss>

