Forum Discussion

abhidotnet's avatar
abhidotnet
Advocate II
7 months ago

Faker Works in PySpark… but Not Python

I ran into while trying to use the Faker library inside both PySpark and Python notebooks in Microsoft Fabric. I’m hoping this helps others, and I’d love confirmation from the product team on whether this is the expected behavior.

Summary of what I discovered

  • I created a custom Environment in my workspace (called TestforTrial) and added the faker library under Libraries from external repositories.

  • When I open a PySpark notebook, I can attach this environment and use Faker without any issues.

  • When I open a Python notebook, the environment does not appear in the kernel dropdown. I only see Python 3.10 and Python 3.11.

  • It turns out that Python notebooks (preview) currently do not support attaching custom Environments.

  • They only support %pip install inside the notebook session.

This explains why my environment only shows Spark runtimes (Spark 3.4, 3.5, etc.) and why I couldn’t select it in a Python notebook.

If this is the intended behavior for now, it would be great to have it documented more clearly, because it’s easy to assume Environments apply to both notebook types.

Is Python‑runtime support for Environments planned?

 

7 Replies

  • v-echaithra's avatar
    v-echaithra
    Community Support

    Hi abhidotnet ,

    Thank you for reaching out to Microsoft Community.
    At the moment, this is a current limitation of Microsoft Fabric rather than a configuration issue. Python notebooks don’t yet support attaching custom Environments, while PySpark notebooks do.
    Right now, you must use %pip install in Python notebooks or use PySpark notebooks to attach environments.

    Since this affects dependency management and consistency across notebook types, I’d recommend raising a feature request on Fabric Ideas so the product team can track demand and prioritize Python-runtime support for Environments. It’s likely the best way to get visibility and an official response on roadmap timing.

    You’re welcome to post this in the Ideas forum here: Fabric Ideas - Microsoft Fabric Community

    That’s where enhancement suggestions go. The Power BI team actively reviews and prioritizes ideas based on community feedback and votes.

    Thank you.

  • Hi abhidotnet  

     

    What you've discovered is correct, Python notebooks run on a pure kernel. They are in Public Preview and 

    don’t integrate with Fabric “Environments.” Instead, they support inline package installs via %pip/%conda in the notebook session and allow dropping custom libs into the notebook’s Resources folder.
     

     

     
    There isn’t a public roadmap item that explicitly confirms when “attach Fabric Environments to Python notebooks.” will be made available. 
     
    Hope this helps - please appreciate by leaving a Kudos or accepting as a Solution