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.
Solved! Go to Solution.
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
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
Step by step procedure:
WinPython solution with a minor edit.
Step by step procedure:
Python home directory as something like C:\WPy64-3770\python-3.7.7.amd64
wow, that really worked. thank you so much
Stephan
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
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/
Thank you for the help. This helped a lot!!
Solved same problem by uninstalling Anaconda and installing Miniconda3 Windows 64-bit with Python 3.7 + pandas and matplotlib packages
Hi @Anonymous ,
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
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
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.
User | Count |
---|---|
357 | |
199 | |
68 | |
66 | |
48 |