cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Power BI Python with Anaconda missing dependency

Hi,

 

I'm trying to use my Python script in Power BI, however I'm faced with this error message when trying to run it: 

 

Details: "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\name\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']
"

I understand that it has something to do with the Anaconda environment not being activated. But is there a fix for this? I'd really like to avoid working with multiple Python versions. 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Visitor

Re: Power BI Python with Anaconda missing dependency

The Python environment I'm referring to already has the required dependencies installed. I was suspecting the error to be caused by the activate.bat file not activating the Python environment in Anaconda, prior to running the script. However, I managed to resolve my problem simply by updating Python in Anaconda Prompt i.e. 

conda upgrade python

View solution in original post

10 REPLIES 10
Highlighted
Solution Sage
Solution Sage

Re: Power BI Python with Anaconda missing dependency

Hi @artemvk ,

The error message "ImportError: Missing required dependencies ['numpy']" indicates that some library you imported requires the dependencies ['numpy'], after checking your code, it should be pandas.

In this scenario, we can install the numpy library by using the "pip install numpy".

Best Regards,

Teige

Highlighted
Frequent Visitor

Re: Power BI Python with Anaconda missing dependency

The Python environment I'm referring to already has the required dependencies installed. I was suspecting the error to be caused by the activate.bat file not activating the Python environment in Anaconda, prior to running the script. However, I managed to resolve my problem simply by updating Python in Anaconda Prompt i.e. 

conda upgrade python

View solution in original post

Highlighted
Frequent Visitor

Re: Power BI Python with Anaconda missing dependency

Solved same problem by uninstalling Anaconda and installing Miniconda3 Windows 64-bit with Python 3.7 + pandas and matplotlib packages

Highlighted
Advocate I
Advocate I

Re: Power BI Python with Anaconda missing dependency

Some more flavor on this from Nov 2019.

 

After many, many, many troubleshooting itterations, the only evnironment version that works is the one with pip-installed matplotlib, pandas and numpy

As soon as conda install touches either pandas or numpy in particular - the two get desynced. 

 

Here is a working collection:

astroid 2.3.1
certifi 2019.9.11
colorama 0.4.1
cycler 0.10.0
isort 4.3.21
kiwisolver 1.1.0
lazy-object-proxy 1.4.2
matplotlib 3.1.1
mccabe 0.6.1
numpy 1.17.4
pandas 0.25.3
pip 19.3.1
pylint 2.4.2
pyparsing 2.4.5
python-dateutil 2.8.1
pytz 2019.3
setuptools 41.6.0.post20191030
six 1.12.0
typed-ast 1.4.0
wheel 0.33.6
wincertstore 0.2
wrapt 1.11.2

 

Highlighted
Frequent Visitor

Re: Power BI Python with Anaconda missing dependency

I had a lot of difficulties making Python working with Power BI

 

The solution I'm using : an independent install of Python with https://winpython.github.io/

Highlighted
Frequent Visitor

Re: Power BI Python with Anaconda missing dependency

 can you please refere to a step-by-set setup. It seems using python directory and IDE anaconda's python exe file

 

I cannot get it run with a demo script 

Highlighted
Frequent Visitor

Re: Power BI Python with Anaconda missing dependency

Step by step procedure: 

  1. Download last version of Winpython from : https://winpython.github.io/
  2. Install Winpython on C: \
  3. In Power BI Desktop, select File > Options and settings > Options > Python scripting. The Python script options page appears. 
  4. Specify the local Python installation path with the Winpython folder defined at step 2
  5. Restart Power BI
Highlighted
Frequent Visitor

Re: Power BI Python with Anaconda missing dependency

wow, that really worked. thank you so much

 

Stephan

Highlighted
Advocate II
Advocate II

Re: Power BI Python with Anaconda missing dependency

Every Anaconda environment requires activation before you can use it properly. Sounds familiar?

 

1. Open the Anaconda prompt.

2. Activate the environement that you configured in the PowerBI Desktop Scripting Options.

3. Start your PBIDesktop.exe from the prompt.

 

Simple as that.

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors