Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! 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.
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.
| User | Count |
|---|---|
| 56 | |
| 33 | |
| 33 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 68 | |
| 67 | |
| 45 | |
| 30 | |
| 26 |