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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Estou programando um script em Python para criar um visual no Power BI. Nesse script, estou utilizando uma API da IA Gemini, e usando minha uma chave de acesso. O código está funcionando no Power Bi desktop.
O problema é que, quando publico o relatório no Workspace, ocorre um erro no visual Python. Ou seja, o visual retorna um erro no visual publicado. Perceba que a chave de acesso à API Gemini está salva localmente no script.
O erro é: erro no tempo de execução do script.
Segue o Script:
Solved! Go to Solution.
Did you check if the library is supported?
Python visualizations in Power BI Service | Microsoft Power BI Blog | Microsoft Power BI
Learn which Python packages are supported - Power BI | Microsoft Learn
Did you set up a personal gateway? Was it running when you tried the report in the service?
Hi @David_FGL,
Thanks for reaching out to the Microsoft fabric community forum.
It looks like the problem which you are facing is coming maybe because of python visuals in PowerBi service runs on a cloud environment and not on your local system which has all the required libraries and APIs in the local environment. There may be some restrictions on the cloud environment that causes the issue with your scripts.
If this is the case then you can try to use PowerBi parameters to store your API key as its a security risk and won't work in the PowerBi service. Make sure that the workspace you are using might have the required permissions or settings enabled for Python visuals. Also as mentioned earlier by @lbendlin, ensure that the libraries and dependencies which you are using are supported by PowerBi Service.
If you have any other questions please feel free to contact me.
Best Regards,
Hammad.
Community Support Team
If this post helps then please mark it as a solution, so that other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Thank you.
Hi @David_FGL,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Hi @David_FGL,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
Hi @David_FGL,
As we haven’t heard back from you, so just following up to our previous message. I'd like to confirm if you've successfully resolved this issue or if you need further help?
If yes, you are welcome to share your workaround and mark it as a solution so that other users can benefit as well. If you find a reply particularly helpful to you, you can also mark it as a solution.
If you still have any questions or need more support, please feel free to let us know. We are more than happy to continue to help you.
Thank you for your patience and look forward to hearing from you.
Hi @David_FGL,
Thanks for reaching out to the Microsoft fabric community forum.
It looks like the problem which you are facing is coming maybe because of python visuals in PowerBi service runs on a cloud environment and not on your local system which has all the required libraries and APIs in the local environment. There may be some restrictions on the cloud environment that causes the issue with your scripts.
If this is the case then you can try to use PowerBi parameters to store your API key as its a security risk and won't work in the PowerBi service. Make sure that the workspace you are using might have the required permissions or settings enabled for Python visuals. Also as mentioned earlier by @lbendlin, ensure that the libraries and dependencies which you are using are supported by PowerBi Service.
If you have any other questions please feel free to contact me.
Best Regards,
Hammad.
Community Support Team
If this post helps then please mark it as a solution, so that other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Thank you.
Did you check if the library is supported?
Python visualizations in Power BI Service | Microsoft Power BI Blog | Microsoft Power BI
Learn which Python packages are supported - Power BI | Microsoft Learn
Did you set up a personal gateway? Was it running when you tried the report in the service?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!