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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

VS Code notebook failure - Spark

I want to integrate VS code with my Fabric workspace and I have been able to successfully do it. I have followed all the pre-requisites mentioned in this link - https://learn.microsoft.com/en-us/fabric/data-engineering/setup-vs-code-extension.

 

But when I try to run any spark related commands in VS code, I get an error - "AttributeError: 'NoneType' object has no attribute 'sql'" and "spark is not defined Pylance". However these commands are successfully running in Fabric.

 

My kernel specification is - fabric-synapse-runtime-1-2(Python 3.10.12)

 

As a quick fix, I tried to reinstall VS Code and the extension but unfortunately nothing worked. 
Would appreciate any quick help or solution on this.

 

Thanks.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

The solution that worked for me is - Re-installing VS Code by clearing the cache files as well during uninstallation.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous 

Thanks for using Fabric Community.
Please follow these steps:
1) Right click the ipython notebook

vnikhilanmsft_0-1716961444941.png

 

 



Reveal in File Explorer

2) Open the python log file: ../../../logs/${NOTEBOOK_ARTIFACT_ID}/PySparkLighter.log and check the session failure reason

vnikhilanmsft_1-1716961444722.png

 

Please attach the screenshot of the error here to understand what is happening.

You can also try stopping the spark session in the Notebook and try running in VS code. 
Thanks

Anonymous
Not applicable

Hi @Anonymous, 

Here is the screenshot of the logs that i can see.

MMBI_0-1716968525418.png

 

Also how do I stop the Spark session in notebook and run in VS code?

 

Thanks.

Anonymous
Not applicable

The solution that worked for me is - Re-installing VS Code by clearing the cache files as well during uninstallation.

Anonymous
Not applicable

Hi @Anonymous 
Glad that your query got resolved. Please continue using Fabric Community for any help regarding your queries.

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Free Fabric Certifications

Free Fabric Certifications

Get Fabric certified for free! Don't miss your chance.

January Fabric Update Carousel

Fabric Monthly Update - January 2026

Check out the January 2026 Fabric update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (10,784)