Forum Discussion

pouyanebrahimi's avatar
6 years ago
Solved

Python is not running in Power BI

My python version is: Winpython64-3.7.4.0 and my PowerBi version is: Power BI Desktop (September 2019). This is what I have done: 1. loading a csv file into Power BI; 2. then, home>Edit Querries> this will open a new window. In this window, I went to Transform> Run Python Script > after choosing that, a new window opens that I am supposed to write a python code. I tried different options such as: no code, or a simple code (import pandas as pd; df=pd.DataFrame(dataset)). None of them works! I just recive error below:

"DataSource.Error: ADO.NET: A problem occurred while processing your Python script.
Here are the technical details: Process must exit before requested information can be determined.
Details:
DataSourceKind=Python
DataSourcePath=Python
Message=A problem occurred while processing your Python script.
Here are the technical details: Process must exit before requested information can be determined.
ErrorCode=-2147467259
ExceptionType=Microsoft.PowerBI.Scripting.Python.Exceptions.PythonUnexpectedException"

 

I deeply appreicate if you could help me to fix this issue! I already spent mopre than 1 day on this.

 

 

  • Hi pouyanebrahimi ,

    When I first try to reproduce your problem, it works well. However, after I changed the Privacy levels of Python and the data source file, the same issue appeared.

     

    Then, I tried these steps and it works well now.

    1. Clear permissions of Python and the data source file.

    2. Continue what you said.

    If the issue is still there, please let me know.

     

    Best Regards,

    Icey

     

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

     

6 Replies

  • Icey's avatar
    Icey
    Community Support

    Hi pouyanebrahimi ,

    When I first try to reproduce your problem, it works well. However, after I changed the Privacy levels of Python and the data source file, the same issue appeared.

     

    Then, I tried these steps and it works well now.

    1. Clear permissions of Python and the data source file.

    2. Continue what you said.

    If the issue is still there, please let me know.

     

    Best Regards,

    Icey

     

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

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Im still gettin the same error after changing the permission as suggested on solution. Any feedback please.

    • pouyanebrahimi's avatar
      pouyanebrahimi
      Helper I

      It should work! 

      Try to test you python-power conencting in a new power bi file. 

      • Anonymous's avatar
        Anonymous
        Not applicable

        I also tried just the dataset to hold = # 'dataset' holds the input data for this script
        still not working.
        im using python 3.8