Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi all,
I am trying to see my python code in Power BI but I am having issues. I wrote my code on Jupyter Notebook and it works properly and shows the plot I want to see. However, when I try to run the same code in Power BI I am getting this error. Help would be appreciated.
Feedback Type:
Frown (Error)
Timestamp:
2022-06-28T16:08:34.9176205Z
Local Time:
2022-06-28T12:08:34.9176205-04:00
Session ID:
13ff79aa-df05-4f7a-8691-30b71e869154
Release:
May 2022
Product Version:
2.105.1143.0 (22.05) (x64)
Error Message:
Python script error.
Traceback (most recent call last):
File "C:\Users\z004knym\PythonScriptWrapper_7bcb9799-2e5e-4fcd-96e6-45deaf24f627\PythonScriptWrapper.PY", line 2, in <module>
import os, uuid, matplotlib
ModuleNotFoundError: No module named 'matplotlib'
Solved! Go to Solution.
Hi @Anonymous
According to the error message, it couldn't find the 'Matplotlib' module from the current directory. You need to install the module explicitly using the pip installer because Matplotlib is not a built-in module (it doesn’t come with the default python installation) in Python. See Install required Python packages
However, since you can run the code on Jupyter Notebook correctly, you already have Matplotlib in its environment. I guess probably you have installed Anaconda along with Jupyter Notebook, in this case you can also use Anaconda's Python directory in Power BI because Matplotlib is included in Anaconda. You can refer to PYTHON IN POWER BI: ENABLING PYTHON SCRIPTS WITH ANACONDA ENVIRONMENT
Other reference:
https://community.powerbi.com/t5/Custom-Visuals-Development/Python-Integration-Error/td-p/677350
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi @Anonymous
According to the error message, it couldn't find the 'Matplotlib' module from the current directory. You need to install the module explicitly using the pip installer because Matplotlib is not a built-in module (it doesn’t come with the default python installation) in Python. See Install required Python packages
However, since you can run the code on Jupyter Notebook correctly, you already have Matplotlib in its environment. I guess probably you have installed Anaconda along with Jupyter Notebook, in this case you can also use Anaconda's Python directory in Power BI because Matplotlib is included in Anaconda. You can refer to PYTHON IN POWER BI: ENABLING PYTHON SCRIPTS WITH ANACONDA ENVIRONMENT
Other reference:
https://community.powerbi.com/t5/Custom-Visuals-Development/Python-Integration-Error/td-p/677350
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Check out the April 2026 Power BI update to learn about new features.
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.
| User | Count |
|---|---|
| 48 | |
| 40 | |
| 37 | |
| 20 | |
| 16 |
| User | Count |
|---|---|
| 69 | |
| 67 | |
| 32 | |
| 27 | |
| 26 |