<?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: mssparkutils inside python package in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/mssparkutils-inside-python-package/m-p/3562857#M1233</link>
    <description>&lt;P&gt;I've gone back and built a very simple example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Inside a notebook I can run:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;def run_me_local():
    help(mssparkutils)

run_me_local()&lt;/LI-CODE&gt;
&lt;P&gt;and it happily returns the help description for mssparkutils.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I wrap the same thing in a python wheel package and import it into an environment:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bcdobbs_0-1701426537471.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1005082iE67CF451A2A04122/image-size/medium?v=v2&amp;amp;px=400" role="button" title="bcdobbs_0-1701426537471.png" alt="bcdobbs_0-1701426537471.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;My question is how do I build a wheel file that "knows" about mssparkutils? In my local environment mssparkutils doesn't exist which I suspect is problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Full code used to produce the wheel:&lt;/P&gt;
&lt;P&gt;my_code.py:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;def run_me():
    help(mssparkutils)&lt;/LI-CODE&gt;
&lt;P&gt;setup.py (guessing I need mssparkutils in the install_requires but it then says it doesn't exist:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;from setuptools import setup, find_packages

setup(
    name='wheel_test',
    version='0.1',
    packages=find_packages(),
    install_requires=[

    ],
    author='Ben Dobbs',
    author_email='email@email.com',
    description='Wheel Testing',
    long_description=open('README.md').read(),
    long_description_content_type='text/markdown',
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 01 Dec 2023 10:32:51 GMT</pubDate>
    <dc:creator>bcdobbs</dc:creator>
    <dc:date>2023-12-01T10:32:51Z</dc:date>
    <item>
      <title>mssparkutils inside python package</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/mssparkutils-inside-python-package/m-p/3561986#M1231</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've started to build a set of helper functions for my fabric notebooks to do things like refreshes and getting attachments from emails. Mostly just wrappers round msal and requests.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code runs fine direct in a notebook. I've then wrapped it in a wheel file and imported which again works. However when executing the imported code, the notebook says mssparkutils isn't recognised. Any ideas hiw I reference it correctly?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Code is in:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://github.com/ArchwayTrust/Fabric-PythonHelper" target="_blank" rel="noopener"&gt;https://github.com/ArchwayTrust/Fabric-PythonHelper&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;thanks&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Ben&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2023 23:06:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/mssparkutils-inside-python-package/m-p/3561986#M1231</guid>
      <dc:creator>bcdobbs</dc:creator>
      <dc:date>2023-11-30T23:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: mssparkutils inside python package</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/mssparkutils-inside-python-package/m-p/3562446#M1232</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/168297"&gt;@bcdobbs&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Thanks for using Fabric Community.&lt;BR /&gt;Have you run the code in Fabric Notebook?&amp;nbsp;&amp;nbsp;Did you install some other whl which includes notebookutils package?&amp;nbsp;&lt;BR /&gt;How did you execute the imported code? Can you please provide me some screenshots along with the error message?&lt;BR /&gt;This would help me in understanding the issue better.&lt;BR /&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 05:56:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/mssparkutils-inside-python-package/m-p/3562446#M1232</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-12-01T05:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: mssparkutils inside python package</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/mssparkutils-inside-python-package/m-p/3562857#M1233</link>
      <description>&lt;P&gt;I've gone back and built a very simple example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Inside a notebook I can run:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;def run_me_local():
    help(mssparkutils)

run_me_local()&lt;/LI-CODE&gt;
&lt;P&gt;and it happily returns the help description for mssparkutils.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I wrap the same thing in a python wheel package and import it into an environment:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bcdobbs_0-1701426537471.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1005082iE67CF451A2A04122/image-size/medium?v=v2&amp;amp;px=400" role="button" title="bcdobbs_0-1701426537471.png" alt="bcdobbs_0-1701426537471.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;My question is how do I build a wheel file that "knows" about mssparkutils? In my local environment mssparkutils doesn't exist which I suspect is problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Full code used to produce the wheel:&lt;/P&gt;
&lt;P&gt;my_code.py:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;def run_me():
    help(mssparkutils)&lt;/LI-CODE&gt;
&lt;P&gt;setup.py (guessing I need mssparkutils in the install_requires but it then says it doesn't exist:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;from setuptools import setup, find_packages

setup(
    name='wheel_test',
    version='0.1',
    packages=find_packages(),
    install_requires=[

    ],
    author='Ben Dobbs',
    author_email='email@email.com',
    description='Wheel Testing',
    long_description=open('README.md').read(),
    long_description_content_type='text/markdown',
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 10:32:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/mssparkutils-inside-python-package/m-p/3562857#M1233</guid>
      <dc:creator>bcdobbs</dc:creator>
      <dc:date>2023-12-01T10:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: mssparkutils inside python package</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/mssparkutils-inside-python-package/m-p/3562908#M1234</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/168297"&gt;@bcdobbs&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Thanks for explaining the issue.&lt;BR /&gt;Please install dummy notebookutils in local environment. This will solve your issue.&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;pip install dummy-notebookutils&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;For more information please refer to this link&lt;STRONG&gt;:&amp;nbsp;&lt;/STRONG&gt;&lt;A href="https://pypi.org/project/dummy-notebookutils/" target="_blank" rel="noopener"&gt;dummy-notebookutils&lt;/A&gt;&amp;nbsp;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;Hope this helps. Please let me know if you have any further questions.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 11:07:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/mssparkutils-inside-python-package/m-p/3562908#M1234</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-12-01T11:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: mssparkutils inside python package</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/mssparkutils-inside-python-package/m-p/3562922#M1235</link>
      <description>&lt;P&gt;Thanks I literally just found it works ok if I add&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;from notebookutils import mssparkutils&lt;/LI-CODE&gt;
&lt;P&gt;The dummy-notebookutils stops it complaining locally though so thank you for that.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 11:15:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/mssparkutils-inside-python-package/m-p/3562922#M1235</guid>
      <dc:creator>bcdobbs</dc:creator>
      <dc:date>2023-12-01T11:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: mssparkutils inside python package</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/mssparkutils-inside-python-package/m-p/3562931#M1236</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/168297"&gt;@bcdobbs&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Glad that your query got resolved. Please continue using Fabric Community for any help regarding your queries.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 11:20:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/mssparkutils-inside-python-package/m-p/3562931#M1236</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-12-01T11:20:59Z</dc:date>
    </item>
  </channel>
</rss>

