Reputation: 483
I am pretty new in Power BI
and I try to set up the python script in it.
I have changed the option and activated the Python scripting
. After that I get the error:
DataSource.Error: ADO.NET: Python script error.
Traceback (most recent call last):
File "PythonScriptWrapper.PY", line 2, in <module>
import os, pandas, matplotlib.pyplot
File "C:\Users\mm\AppData\Local\Continuum\anaconda3\lib\site-packages\pandas\__init__.py", line 19, in <module>
"Missing required dependencies {0}".format(missing_dependencies))
ImportError: Missing required dependencies ['numpy']
Details:
DataSourceKind=Python
I check the conda
list and it contains numpy
.
I have installed numpy
and pandas
again and I got the message below
C:\Users\mm\AppData\Local\Continuum\anaconda3>py -m pip install numpy
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Requirement already satisfied: numpy in c:\users\mm\appdata\local\continuum\anaconda3\lib\site-packages (1.15.4)
C:\Users\mm\AppData\Local\Continuum\anaconda3>py -m pip install pandas
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Requirement already satisfied: pandas in c:\users\mm\appdata\local\continuum\anaconda3\lib\site-packages (0.23.4)
Requirement already satisfied: python-dateutil>=2.5.0 in c:\users\mm\appdata\local\continuum\anaconda3\lib\site-packages (from pandas) (2.7.5)
Requirement already satisfied: pytz>=2011k in c:\users\mm\appdata\local\continuum\anaconda3\lib\site-packages (from pandas) (2018.7)
Requirement already satisfied: numpy>=1.9.0 in c:\users\mm\appdata\local\continuum\anaconda3\lib\site-packages (from pandas) (1.15.4)
Requirement already satisfied: six>=1.5 in c:\users\mm\appdata\local\continuum\anaconda3\lib\site-packages (from python-dateutil>=2.5.0->pandas) (1.12.0)
As you see I am using anaconda3 but there is another Python is installed on my macheine. I tried a lot of ways and nothing could help
Upvotes: 4
Views: 14231
Reputation: 12181
I had a somewhat related problem with Power BI not finding a dependency (matplotlib in my case). In my case, I had multiple versions of Python installed and it was referring to the old one; I just needed to change the configuration to use the most recent version.
Upvotes: 0
Reputation: 161
Open Anaconda Navigator
Create new environment e.g. PowerBIEnvironment
Open Anaconda Prompt
Type command to Activate PowerBIEnvironment - activate PowerBIEnvironment
Install respective libraries e.g. Pip install numpy
Open PowerBI Desktop
Goto File --> Options and Setting --> Options --> Python Scripting -->
Select Other in Detected python home directories
Give newly created environment path in Set a python home directory e.g. C:\Users\XYZPQR\Anaconda3\envs\PowerAutomateEnvironment
Refresh Power BI
Upvotes: 0
Reputation: 29
forget Anaconda and use WinPython. I tried Anaconda for days with all the workarounds available in StackOverflow and other forums, and they took me nowhere. Then I tried WinPython, and it worked immediately. Of course, you will need to change the PowerBI options accordingly.
If you consider my answer above others, you won't need to downgrade Python, PBI, or anything else.
Upvotes: 2
Reputation: 467
Open the Anaconda Prompt: Then, you have to go to the Conda Environment that you want to use in PowerBI. Am having an environment 'temp', so I activate it first in the 'Anaconda Prompt':
(base) C:\Users\ashish>conda activate temp
Then I go to the directory having the "PowerBI" executable file in the installation folder:
(temp) C:\Users\ashish>cd "C:\Program Files\Microsoft Power BI Desktop\bin"
Then, I launch PowerBI from the Prompt:
(temp) C:\Program Files\Microsoft Power BI Desktop\bin>PBIDesktop.exe
This fixes the NumPy error you are getting. If you want any other package to use with PowerBI, install that package in the respective "Conda Environment" (in my case it is "temp").
Upvotes: 5
Reputation: 11
I had similar issue trying to get Power BI to use Anaconda Python. After seeing a post about PBI having issues with Python 3.7 I:
..and that worked fine.
Upvotes: 1
Reputation: 19
I think this error can be due to some numpy issues with Anaconda distribution. I changed the Python path in Power BI to a virtual environment (which uses pip instead of conda to install numpy and other packages) and I had no more issues.
Upvotes: 0