Forum Discussion
Intellisense for custom Python packages not working in Fabric notebooks
- 1 year ago
Hi HoneHealthMB,
We apologize for the inconvenience caused. Please consider raising a Microsoft support ticket for further investigation. You can explain all the troubleshooting steps you have taken to help them better understand the issue.
You can create a Microsoft support ticket with the help of the link below:
https://learn.microsoft.com/en-us/power-bi/support/create-support-ticketIf this helps, please "Accept as solution" and drop a "Kudos" so other members can find it more easily.
Thank you.
Hi HoneHealthMB,
Thank you for reaching out to the Microsoft fabric community forum.
After thoroughly reviewing the details you provided, it seems the core issue is that Pylance (the IntelliSense engine in Fabric notebooks) isn’t rendering the detailed docstrings for your custom package when installed as a wheel, either via a custom Spark environment or notebook resources. The fact that IntelliSense works when the code is directly in the notebook, and that bs4 displays rich IntelliSense, suggests this may be related to how Pylance processes packaged libraries in Fabric’s Spark environment.
Here are a few suggestions to try:
- Ensure your package includes type hints and possibly type stub files. Pylance relies heavily on these for rich IntelliSense. The success of bs4 likely stems from its well-structured metadata, which you could try to emulate in your package structure.
- As a workaround, you could upload your package’s source files to the notebook’s resources folder and add the folder to the Python path. This mimic placing code directly in the notebook and may allow Pylance to display docstrings, though I understand this isn’t ideal for your use case.
- When installing your wheel package (via %pip install or a custom environment), verify that it’s correctly installed in the session’s library path. Restarting the Spark session after installation might help ensure the package is properly loaded.
- Since bs4 works well, analyzing its package structure could provide insights. This might involve looking at its installed files to identify what makes its IntelliSense rendering effective.
For additional guidance on managing Python packages in Fabric notebooks, you may find this official documentation helpful: Using Python Experience on Notebook. It covers package installation and environment setup, which might provide further context.
The fact that even Microsoft’s azure-ai-projects package doesn’t render rich IntelliSense suggests this could be a limitation in Fabric’s Pylance integration, possibly due to its preview status.
If this information is helpful, please “Accept as solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.
Can we get one of the fabric devs to chime in on this?
The reality is that many libraries out there have intellisense working just fine. So it isn't a limitation of the tool. Those libraries are all also installed via packages. pandas is an example. bs4 is another example.
The question is very simple: what is the Fabric UI code trying to do when it loads intellisense/docstrings? You can clearly see it doing a little "loading..." thing for a split second - so where is it trying to get that info from?
- v-ssriganesh1 year agoCommunity Support
Hi HoneHealthMB,
Thank you for your follow-up and for pointing out that libraries like pandas and bs4 render IntelliSense well, which shows this isn’t a limitation of Fabric’s tools. Your observation of the “Loading…” message in the UI is a great clue it suggests Pylance is trying to fetch docstring data but not succeeding for your custom wheel package.
The “Loading…” likely indicates Pylance is querying your package’s metadata or files in the Spark environment’s library path, possibly missing type information (e.g: type stubs or a py.typed file) that pandas and bs4 include. Here are some next steps to try:
- Check if pandas or bs4 include type-related files your package might need to enable rich IntelliSense.
- Ensure your custom Spark environment is configured correctly, as outlined in the Using Python Experience on Notebook page. Restarting the session might help Pylance.
- Temporarily using source files in the notebook’s resources folder could confirm if Pylance reads docstrings differently from your wheel package.
If this response helps, consider marking it as “Accept as solution” and giving a “kudos” to assist other community members.
Thank you.- HoneHealthMB1 year agoAdvocate I
I'm fairly new to python - is there a relatively straightforward way to determine precisely what is in the bs4 package?
- v-ssriganesh1 year agoCommunity Support
Hello HoneHealthMB,
Even if you're newer to Python, there are a few straightforward ways to explore what’s included in the bs4 package, even if you’re new to Python.One easy approach is to locate where the package is installed in your environment and then browse its contents. You can do this either from within the notebook using basic Python tools (like checking the file path of an imported package) or by exploring the installed packages folder directly via the notebook file browser or environment settings.
You're specifically looking for:
- A py.typed file — which marks the package as having type information
- Any .pyi stub files — these provide explicit type definitions that tools like IntelliSense can use
- Well-documented source files with structured docstrings and type hints
Another helpful option is to review the package on GitHub or PyPI. For example, bs4 is available on GitHub, where you can see how its files and docstrings are organized.
If this reply helps, please consider marking it as "Accept as solution" and giving it a kudos to support others in the community.