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

The Fabric community is upgrading! Read all of the details including the timeline and what you can expect. 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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

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.