We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi,
I am running a python script on top of my dataset in power bi for anomaly detection. The script looks up a pre-trained model on my computer and applies it to the dataset in power bi. Below is the python script that is run in power bi.
The script runs fine and the dataset refreshes in power bi desktop, but when I publish to power bi service I get the following error when I try to setup schedule refresh.
ModuleNotFoundError: No module named 'matplotlib
I have checked my environment and I have the compatible version of matplotlib installed. I also have the personal gateway install on the same computer as the python files.
Any help would be greatly appreciated.
Thanks
Hi @shanecosgrove1 ,
The problem doesn't seem to be in Power BI, I found a similar post on the web, please check if the solution in the picture below helps you.
ImportError: No module named matplotlib.pyplot
Hope it helps,
Community Support Team _ Caitlyn
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi. I guess I'm trying to understand here. Why would you even import matplotlib in a script? that's a visualization library that you can use in the visuals. You shouldn't include it in the script bringing the data.
You can check the libraries for visualizations in service in here: https://docs.microsoft.com/en-us/power-bi/connect-data/service-python-packages-support#python-packag...
I hope removing that may fix it. If you need to use matplotlib in a visual you have to import it right there.
Happy to help!
Hi ,
I get the same error if I remove the import matplotlib line from the python code. They only reason I added it was to see if it would solve the problem but it doesn't matter if I include or exclude it i still get the same error in service.
When using python in power bi the environement needs Pandas and Matplotlib to be installed.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.