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

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.

Reply
fooddata15
Frequent Visitor

Please wait while we establish a connection to python

I've reinstalled Python 3.96/windows and can't seem to have any luck running this script. I just get the "Please wait while we establish a connection to python" spinning window that never changes. Any ideas?

P.S. Yes, I did put in the correct authorization info in the headers 🙂

 

 

 

import requests
import json

def get_all_time_entries():

    url_address = "https://api.harvestapp.com/v2/time_entries"  
    headers = {
        "Authorization": "Bearer " + "xxxxxxxxxx",
        "Harvest-Account-ID": "xxxxxx"
    }

    # find out total number of pages
    r = requests.get(url=url_address, headers=headers).json()
    total_pages = int(r['total_pages'])

    # results will be appended to this list
    all_time_entries = []

    # loop through all pages and return JSON object
    for page in range(1, total_pages):

        url = "https://api.harvestapp.com/v2/time_entries?page="+str(page)              
        response = requests.get(url=url, headers=headers).json()        
        all_time_entries.append(response)       
        page += 1

    # prettify JSON
    data = json.dumps(all_time_entries, sort_keys=True, indent=4)

    return data

print(get_all_time_entries())

 

 

3 REPLIES 3
fooddata15
Frequent Visitor

No resolution... ultimately I ran on another machine to test and still had query issues even after making sure all additional packages were in.

Anonymous
Not applicable

Hi @fooddata15 

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 you are still confused about it, please provide me with more details about your problem.

 

Best Regards,

Rico Zhou

Anonymous
Not applicable

Hi @fooddata15 

Currently you have installed Python 3.96/windows , when you connect to data source by python, it alway show loading.

1. Please check your network setting, the fire wall and check .Net in your PC.

2. Please download the latest version of Power BI Desktop and try again.

Link: Download Microsoft Power BI Desktop from Official Microsoft Download Center

3. According to your code, I think you may want to get data by Rest API. You can try to connect to Rest API by Web connector.

For Reference: Using a REST API as a data source

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.