Forum Discussion

VoltesDev's avatar
VoltesDev
Helper V
1 year ago
Solved

Need guide: PySpark (Fabric runtime)

Hello good people,

 

I have requirement in my Fabric Notebook to read Excel file put in Lakehouse. And my Fabric now is in Trial Mode.

 

The requirement, is to use "msparkutils" and I start it with importing the feature, as per usual : "import mssparkutils"

But I'm getting this error:

ModuleNotFoundError Traceback (most recent call last) Cell In[8], line 1 ----> 1 import mssparkutils  ModuleNotFoundError: No module named 'mssparkutils'

 

When "consult " with ChatGpt, it is saying that I need to create the notebook from Lakehouse, but I did create New notebook from my Lakehouse. and it is saying the Session supposed to be "PySpark (Fabric runtime)" while mine is "PySpark (Python)"

 

May I know what is the real problem ?

May I know what I need to do regarding this  ?

Thanks,

 

 

 

 

 

 

 

 

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi VoltesDev,

    Thank you for reaching out in Microsoft Community Forum.

    Thank you suparnababu8    for the helpful response.

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

    Please continue using Microsoft community forum.

    Regards,
    Pavan.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi VoltesDev,

    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  as  Solution" and give a 'Kudos' so other members can easily find it.

    Thank you,
    Pavan.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi VoltesDev,

    I wanted to follow up since we haven't heard back from you regarding our last response. We hope your issue has been resolved.
    If the community member's answer your query, please mark it as "Accept as Solution" and select "Yes" if it was helpful.
    If you need any further assistance, feel free to reach out.

    Please continue using Microsoft community forum.

    Thank you,
    Pavan.

  • Hi VoltesDev ,

    The issue you're facing is due to the notebook session type. The msparkutils module is only available when your notebook is running under the "PySpark (Fabric runtime)" session—not the standard "PySpark (Python)" session.

    Here's what you can do:

    1. Switch the Session Type:

      • In your notebook, look at the top where it says "PySpark (Python)".
      • Click on it and change it to "PySpark (Fabric runtime)".
      • If you don’t see that option, it might be because:
        • You're not in a Lakehouse-attached notebook, or
        • Your trial environment doesn’t support the Fabric runtime yet.
    2. Ensure You're in a Lakehouse Context:

      • Open your Lakehouse.
      • From there, click “New Notebook” directly inside the Lakehouse.
      • This ensures the notebook is properly linked and the Fabric runtime is available.
    3. Trial Mode Limitation:

      • Some trial environments may have limited runtime options. If the Fabric runtime is not available, you might need to request access or wait until it’s enabled for your tenant.

    Let me know if you want help checking your environment or switching the session!