Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I'm trying to fix a python error in power bi.
No module named 'pandas'
I tried running the following in a command prompt and Python command prmpt but I'm getting errors.
pip install pandas pip install matplotlib
Hi @StacyBell2021 ,
Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please feel free to let me know.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @StacyBell2021 ,
Please try:
1. Please install all the packages that you are mentioning in the python script in Power BI, explicitly in Command Prompt.
Open Command Prompt > for example, type in " py -m pip install pandas" without quotes and then try running the py script in Power BI.
2. This could be because the Python installation directory is not added to the system's PATH environment variable.
You can use the command to add pip to your PATH variable from the command promptsetx.
For example, if your Python version is 3.9, you can type:
setx PATH "%PATH%;C:\Python39\Scripts"
3.Open the Anaconda Prompt or Command Prompt as an administrator.
cd C:\Python\
python -m pip install pandas
python -m pip install matplotlib
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
How do I find where python is installed
Hi @StacyBell2021 ,
You can find out where Python is installed on your Windows machine by following these steps:
1. Type Python in the Windows Search Bar.
2. Right-click on the Python App, and then select “Open file location” .
3. Right-click again on the Python shortcut, and then select “Properties”.
4. You’ll now get the location/path where your Python is installed on Windows .
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
It didn't work.
In the second picture, while in Phython environment, just type install pandas (no pip)
I meant to reply here. error