Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Anonymous
Not applicable

Python while loop in power query version above 3.9.0

Hi everyone I have a case i really can t understand:

my python code in power query uses a while loop as below:

while i < len(XXX):

 

This works fine in python version 3.9.0 but not in 3.9.4 ???

 

Any one had the same issue or better a solution of this issue (apart from  downgradding to 3.9.0)

 

tks in advance

3 REPLIES 3
rohit1991
Super User
Super User

The issue is likely due to differences in the Python environment or library versions. Solutions:

  1. Check Python Path: Ensure Power Query uses the correct Python path in Options > Python Scripting.
  2. Verify Library Behavior: Check for changes in libraries (e.g., Pandas, NumPy) between Python 3.9.0 and 3.9.4.
  3. Debug in Power Query: Test the script directly in Power Query to identify specific compatibility issues.

Did it work? ✔ Give a Kudo • Mark as Solution – help others too!
Akash_Varuna
Super User
Super User

Could you elaborate the error what you are getting 

You replied to 2 years old post 🙂


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

Helpful resources

Announcements
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.