<?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 Unable to install custom wheel in serverless environment in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/unable-to-install-custom-wheel-in-serverless-environment/m-p/122297#M46732</link>
    <description>&lt;DIV&gt;&lt;SPAN&gt;Hey guys, I have created a custom wheel to hold my common code. Since I cannot install task libraries on a serverless environment, I am installing this library in multiple notebooks using %pip install. What I do is I upload the library to a volume in Unity catalog and then create a copy (symlink) of the wheel file with the following name:&lt;BR /&gt;&lt;BR /&gt;package-0.1.0-py3-none-any.whl. -&amp;gt; package-latest-py3-none-any.whl&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;I do this so that I don't have to update the version in every notebook, every time I make a change. When I install the library in a serverless notebook using&amp;nbsp;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;%&lt;/SPAN&gt;&lt;SPAN&gt;pip install &lt;/SPAN&gt;&lt;SPAN&gt;/&lt;/SPAN&gt;&lt;SPAN&gt;Volumes&lt;/SPAN&gt;&lt;SPAN&gt;/catalog_name&lt;/SPAN&gt;&lt;SPAN&gt;/&lt;/SPAN&gt;&lt;SPAN&gt;libs&lt;/SPAN&gt;&lt;SPAN&gt;/&lt;/SPAN&gt;&lt;SPAN&gt;artifacts&lt;/SPAN&gt;&lt;SPAN&gt;/package&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;latest&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;py3&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;none&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;any&lt;/SPAN&gt;&lt;SPAN&gt;.whl, it worked fine. But as soon as I run this notebook as a job, I get this error during the install:&lt;BR /&gt;ERROR: Invalid requirement: 'package==latest': Expected end or semicolon (after name and no valid version specifier) package==latest&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;BR /&gt;I am not able to get past this issue yet. Can anyone suggest the right way to do this?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Fri, 20 Jun 2025 01:01:57 GMT</pubDate>
    <dc:creator>lezwon</dc:creator>
    <dc:date>2025-06-20T01:01:57Z</dc:date>
    <item>
      <title>Unable to install custom wheel in serverless environment</title>
      <link>https://community.databricks.com/t5/data-engineering/unable-to-install-custom-wheel-in-serverless-environment/m-p/122297#M46732</link>
      <description>&lt;DIV&gt;&lt;SPAN&gt;Hey guys, I have created a custom wheel to hold my common code. Since I cannot install task libraries on a serverless environment, I am installing this library in multiple notebooks using %pip install. What I do is I upload the library to a volume in Unity catalog and then create a copy (symlink) of the wheel file with the following name:&lt;BR /&gt;&lt;BR /&gt;package-0.1.0-py3-none-any.whl. -&amp;gt; package-latest-py3-none-any.whl&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;I do this so that I don't have to update the version in every notebook, every time I make a change. When I install the library in a serverless notebook using&amp;nbsp;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;%&lt;/SPAN&gt;&lt;SPAN&gt;pip install &lt;/SPAN&gt;&lt;SPAN&gt;/&lt;/SPAN&gt;&lt;SPAN&gt;Volumes&lt;/SPAN&gt;&lt;SPAN&gt;/catalog_name&lt;/SPAN&gt;&lt;SPAN&gt;/&lt;/SPAN&gt;&lt;SPAN&gt;libs&lt;/SPAN&gt;&lt;SPAN&gt;/&lt;/SPAN&gt;&lt;SPAN&gt;artifacts&lt;/SPAN&gt;&lt;SPAN&gt;/package&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;latest&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;py3&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;none&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;any&lt;/SPAN&gt;&lt;SPAN&gt;.whl, it worked fine. But as soon as I run this notebook as a job, I get this error during the install:&lt;BR /&gt;ERROR: Invalid requirement: 'package==latest': Expected end or semicolon (after name and no valid version specifier) package==latest&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;BR /&gt;I am not able to get past this issue yet. Can anyone suggest the right way to do this?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Fri, 20 Jun 2025 01:01:57 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unable-to-install-custom-wheel-in-serverless-environment/m-p/122297#M46732</guid>
      <dc:creator>lezwon</dc:creator>
      <dc:date>2025-06-20T01:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to install custom wheel in serverless environment</title>
      <link>https://community.databricks.com/t5/data-engineering/unable-to-install-custom-wheel-in-serverless-environment/m-p/122461#M46780</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/156120"&gt;@lezwon&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;In my opinion, the issue might be related to how you’re using a &lt;SPAN class=""&gt;symlink&lt;/SPAN&gt;&amp;nbsp;with a &lt;SPAN class=""&gt;.whl&lt;/SPAN&gt; file.&lt;BR /&gt;&lt;BR /&gt;The problem is that &lt;SPAN class=""&gt;pip&lt;/SPAN&gt; doesn’t just care about the file name — it also checks the internal metadata of the &lt;SPAN class=""&gt;.whl&lt;/SPAN&gt; file, which still declares the version as &lt;SPAN class=""&gt;0.1.0&lt;/SPAN&gt;. When you run the notebook as a job, it might try to resolve &lt;SPAN class=""&gt;package==latest&lt;/SPAN&gt; based on the filename, which isn’t a valid version according to Python’s packaging standards (PEP 440), and that could be causing the &lt;SPAN class=""&gt;Invalid requirement&lt;/SPAN&gt; error.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P class=""&gt;It seems like using a symlink in this way might confuse &lt;SPAN class=""&gt;pip&lt;/SPAN&gt; during resolution, especially in job contexts.&lt;BR /&gt;&lt;BR /&gt;Maybe you can resolve:&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;H4&gt;&lt;STRONG&gt;Option 1: Install the actual .whl file with its version (no alias)&lt;/STRONG&gt;&lt;/H4&gt;&lt;P class=""&gt;Instead of creating a symlink like &lt;SPAN class=""&gt;package-latest.whl&lt;/SPAN&gt;, simply install the real &lt;SPAN class=""&gt;.whl&lt;/SPAN&gt; file with its full version:&lt;BR /&gt;&lt;BR /&gt;If you don’t want to hardcode the version in every notebook, consider &lt;SPAN class=""&gt;&lt;STRONG&gt;parameterizing it using widgets&lt;/STRONG&gt;&lt;/SPAN&gt; or environment variables when running as a job.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;H4&gt;&lt;STRONG&gt;Option 2: Dynamically detect and install the latest wheel&lt;/STRONG&gt;&lt;/H4&gt;&lt;P class=""&gt;Instead of relying on symlinks, you can upload your &lt;SPAN class=""&gt;.whl&lt;/SPAN&gt; files using proper versioning (&lt;SPAN class=""&gt;package-0.1.0.whl&lt;/SPAN&gt;, &lt;SPAN class=""&gt;package-0.1.1.whl&lt;/SPAN&gt;, etc.), and write a small script that automatically installs the most recent one:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;files = dbutils.fs.ls("&amp;lt;path&amp;gt;")

latest = sorted([f for f in files if f.name.startswith("package-") and f.name.endswith(".whl")])[-1].path

%pip install {latest}&lt;/LI-CODE&gt;&lt;P class=""&gt;(something like that)&lt;/P&gt;&lt;P class=""&gt;This way, you avoid using symlinks or naming tricks, and still always install the latest version available in your volume.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;H4&gt;&lt;STRONG&gt;Option 3: Publish&lt;/STRONG&gt;&lt;/H4&gt;&lt;P class=""&gt;By the way, if you publish your package to a &lt;SPAN class=""&gt;&lt;STRONG&gt;package manager like Nexus or Artifactory&lt;/STRONG&gt;&lt;/SPAN&gt;, it’s possible that using &lt;SPAN class=""&gt;package==latest&lt;/SPAN&gt; could actually work as expected.&lt;/P&gt;&lt;P class=""&gt;These platforms manage version indexes and metadata internally, so they can resolve &lt;SPAN class=""&gt;latest&lt;/SPAN&gt; to the most recent published version, even if the filename doesn’t say so. That might help avoid the issues you’re seeing with direct &lt;SPAN class=""&gt;.whl&lt;/SPAN&gt; installation via symlinks.&lt;/P&gt;&lt;P class=""&gt;Hope this helps, &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Isi&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Jun 2025 11:44:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unable-to-install-custom-wheel-in-serverless-environment/m-p/122461#M46780</guid>
      <dc:creator>Isi</dc:creator>
      <dc:date>2025-06-22T11:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to install custom wheel in serverless environment</title>
      <link>https://community.databricks.com/t5/data-engineering/unable-to-install-custom-wheel-in-serverless-environment/m-p/122474#M46785</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/156120"&gt;@lezwon&lt;/a&gt;&amp;nbsp;&amp;nbsp;Unless things have changed and I missed some major update, installing custom wheel files is not supported on serverless instances.&lt;/P&gt;</description>
      <pubDate>Sun, 22 Jun 2025 18:08:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unable-to-install-custom-wheel-in-serverless-environment/m-p/122474#M46785</guid>
      <dc:creator>jameshughes</dc:creator>
      <dc:date>2025-06-22T18:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to install custom wheel in serverless environment</title>
      <link>https://community.databricks.com/t5/data-engineering/unable-to-install-custom-wheel-in-serverless-environment/m-p/122485#M46790</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/145555"&gt;@Isi&lt;/a&gt;&amp;nbsp;, I got around this by creating a requirements.txt file instead of a symlink. With the wheel path in there, I can just do pip install -r /path/to/requirements.txt and have it installed. I am now having another issue where the notebook gives me a&amp;nbsp;&lt;SPAN&gt;ModuleNotFoundError when running as a job, even after installing the package. It works when I run it manually. It also works in another sample job I created to test the problem.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/169511"&gt;@jameshughes&lt;/a&gt;&amp;nbsp;I am able to install and run it in one of my notebooks in a serverless env.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jun 2025 03:04:07 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unable-to-install-custom-wheel-in-serverless-environment/m-p/122485#M46790</guid>
      <dc:creator>lezwon</dc:creator>
      <dc:date>2025-06-23T03:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to install custom wheel in serverless environment</title>
      <link>https://community.databricks.com/t5/data-engineering/unable-to-install-custom-wheel-in-serverless-environment/m-p/122527#M46800</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/156120"&gt;@lezwon&lt;/a&gt;&amp;nbsp;- Very interesting, as I have been wanting to do this and didn't attempt due to finding it was listed as not supported.&amp;nbsp; Can you confirm what cloud provider you are using? AWS, Azure, GCP?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jun 2025 11:35:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unable-to-install-custom-wheel-in-serverless-environment/m-p/122527#M46800</guid>
      <dc:creator>jameshughes</dc:creator>
      <dc:date>2025-06-23T11:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to install custom wheel in serverless environment</title>
      <link>https://community.databricks.com/t5/data-engineering/unable-to-install-custom-wheel-in-serverless-environment/m-p/122529#M46801</link>
      <description>&lt;P&gt;I am using azure&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jun 2025 12:03:09 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unable-to-install-custom-wheel-in-serverless-environment/m-p/122529#M46801</guid>
      <dc:creator>lezwon</dc:creator>
      <dc:date>2025-06-23T12:03:09Z</dc:date>
    </item>
  </channel>
</rss>

