Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
I am trying to run a python script on some data I keep getting this error even If I run nothing like I just run it still gives me this code
DataSource.Error: ADO.NET: A problem occurred while processing your Python script.
Here are the technical details: Access is denied
Details:
DataSourceKind=Python
DataSourcePath=Python
Message=A problem occurred while processing your Python script.
Here are the technical details: Access is denied
ErrorCode=-2147467259
ExceptionType=Microsoft.PowerBI.Scripting.Python.Exceptions.PythonUnexpectedException
With above steps i was able to overcome the acess denied error.
Hi,
Does your script works when run outside of Power BI? Also do you have credentials and permissions set up in "data source settings"?
Proud to be a Super User!
My script runs fine in VS code for the permissions can you guide to check it I could not find Data Source section
UPDATE: I am using the App on Windows 10 and privacy set to none
Here is a good discussion about this in stackoverflow: import - "Access is denied" error while importing CSV to Power BI via Python - Stack Overflow
Basically check these things:
1. Can you access the data source on its own. Also try setting the privacy level to public.
2. Does the Python work outside PBI (you said this is okay)
3. Is the Python installed correctly from PBI's persoective
Proud to be a Super User!
1. Can you access the data source on its own. Also try setting the privacy level to public.
Done
2. Does the Python work outside PBI (you said this is okay)
Yes
3. Is the Python installed correctly from PBI's persoective
yes and it is set in the settings for the location of the python installtion
Hi,
Since the issue persists even with those answers I think the problem is the python location. Going back to the stackoverflow discussion I recommend checking your path settings:
"
If none of that works, and you are using Anaconda the hardest solution is to launch the PowerBI Desktop executable from the Anaconda Prompt after activating the environment in which you want to run the Python script. The command to use to launch Power BI Desktop is as follows:
C:\Program Files\Microsoft Power BI Desktop\bin\PBIDesktop.exe
At that point PowerBI Desktop opens and, repeating the steps from before to run the sample Python code, you should be ok.
NOTE: Please ensure you add Anaconda to System Environment Variable Path list:
C:\ProgramData\Anaconda3 C:\ProgramData\Anaconda3\Scripts C:\ProgramData\Anaconda3\Library\bin
Proud to be a Super User!
My Python Installation was (is) under
You may have to change the locaton inside PowerBI to
C:\Users\YOUR_USER_NAME\AppData\Local\Microsoft\WindowsApps\python
Hope this helps..
kind regards, Enno
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
39 | |
22 | |
21 | |
19 | |
10 |
User | Count |
---|---|
36 | |
35 | |
35 | |
20 | |
14 |