This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
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.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 37 | |
| 32 | |
| 27 | |
| 24 | |
| 17 |
| User | Count |
|---|---|
| 70 | |
| 50 | |
| 31 | |
| 26 | |
| 22 |