Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

Reply
faheemgani
New Member

Custom Library Not Found - ModuleNotFoundError

Currently facing an issue trying to use a custom library within a Fabric workspace.

 

I am creating the library as a .whl file and using %pip install to install it.

 

If I run %pip list after installation I can see my library appear in the list of packages.

 

Processing ./builtin/hwbg_helpers-0.0.1-py3-none-any.whl
Requirement already satisfied: pyarrow in /home/trusted-service-user/cluster-env/trident_env/lib/python3.11/site-packages (from hwbg-helpers==0.0.1) (14.0.2)
Requirement already satisfied: numpy>=1.16.6 in /home/trusted-service-user/cluster-env/trident_env/lib/python3.11/site-packages (from pyarrow->hwbg-helpers==0.0.1) (1.26.4)
Installing collected packages: hwbg-helpers
Successfully installed hwbg-helpers-0.0.1

[notice] A new release of pip is available: 24.0 -> 25.0.1
[notice] To update, run: python -m pip install --upgrade pip
Note: you may need to restart the kernel to use updated packages

 

faheemgani_0-1740668575811.png

 

However when I use the import command 

 

from hwbg_helpers import detect_environment

 

I get the following error back:

 

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[10], line 1
----> 1 from hwbg_helpers import detect_environment

ModuleNotFoundError: No module named 'hwbg_helpers'

 

 

I have tried the following so far:

  • Changing the Spark Runtime within the workspace
  • Changing the Fabric capacity used within the workspace - from our own provisioned capacity to Trial capacity
  • Add custom library into a workspace environment rather than referencing it inline
  • Reinstalling the library with a different name
  • Reinstalling the library with a different version
  • Changing the library altogether and using the code from a known working custom library (from this video: https://www.youtube.com/watch?v=JPyLTwSbdt8)

It is almost as though it has the wrong context when running %pip install and the packages installed in that context are not available elsewhere in the notebook.

1 ACCEPTED SOLUTION
v-menakakota
Community Support
Community Support

Hi @faheemgani ,

Thank you for reaching out to us on the Microsoft Fabric Community Forum.

Since you installed the package inline using %pip install, you may need to restart the kernel for it to be recognized. Click on Kernel > Restart Kernel in your notebook UI. Then, try importing the package again.
Check out the link below,it describes a similar scenario and might help you to resolve the issue.
Solved: Custom Library not found - Microsoft Fabric Community

 

If this post was helpful, please give us Kudos and consider marking Accept as solution to assist other members in finding it more easily.



View solution in original post

4 REPLIES 4
v-menakakota
Community Support
Community Support

Hi @faheemgani ,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

 

Hi @faheemgani ,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.

Thank you.

Hi  @faheemgani ,

I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.

Thank you and Regards,
Menaka.

v-menakakota
Community Support
Community Support

Hi @faheemgani ,

Thank you for reaching out to us on the Microsoft Fabric Community Forum.

Since you installed the package inline using %pip install, you may need to restart the kernel for it to be recognized. Click on Kernel > Restart Kernel in your notebook UI. Then, try importing the package again.
Check out the link below,it describes a similar scenario and might help you to resolve the issue.
Solved: Custom Library not found - Microsoft Fabric Community

 

If this post was helpful, please give us Kudos and consider marking Accept as solution to assist other members in finding it more easily.



Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June FBC25 Carousel

Fabric Monthly Update - June 2025

Check out the June 2025 Fabric update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.