Forum Discussion
Microsoft.PowerBI.Scripting.Python.Exceptions.PythonScriptRuntimeException-Transforming data python
- 6 years ago
I was able to fix this. There is no issue with installation of libraries.
Bug is there in PowerBI. Even after providing the path of Python in settings, it expects environment variable PATH to be set with below paths.
C:\Users\gunjansa\AppData\Local\Continuum\anaconda3
C:\Users\gunjansa\AppData\Local\Continuum\anaconda3\Library\mingw-w64\bin
C:\Users\gunjansa\AppData\Local\Continuum\anaconda3\Scripts
C:\Users\gunjansa\AppData\Local\Continuum\anaconda3\Library\bin
Please get this fixed as this is an unnecessary additional step which took 3 days to debug the issue.
From the source code below, you may lost hard dependency modules, please check if you have installed: numpy, pytz, dateutil.
# flake8: noqa
__docformat__ = "restructuredtext"
# Let users know if they're missing any of our hard dependencies
hard_dependencies = ("numpy", "pytz", "dateutil")
missing_dependencies = []
for dependency in hard_dependencies:
try:
__import__(dependency)
except ImportError as e:
missing_dependencies.append("{0}: {1}".format(dependency, str(e)))
if missing_dependencies:
raise ImportError(
"Unable to import required dependencies:\n" + "\n".join(missing_dependencies)
)
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I was able to fix this. There is no issue with installation of libraries.
Bug is there in PowerBI. Even after providing the path of Python in settings, it expects environment variable PATH to be set with below paths.
C:\Users\gunjansa\AppData\Local\Continuum\anaconda3
C:\Users\gunjansa\AppData\Local\Continuum\anaconda3\Library\mingw-w64\bin
C:\Users\gunjansa\AppData\Local\Continuum\anaconda3\Scripts
C:\Users\gunjansa\AppData\Local\Continuum\anaconda3\Library\bin
Please get this fixed as this is an unnecessary additional step which took 3 days to debug the issue.
- HeliosOne6 years agoFrequent Visitor
Could you explain how actually you define PATH variable with paths in your message? I am facing same problem and my skill is not enough to fix this. A little guide would be great.
Thank you!
- gunjansa_ms6 years ago
Microsoft Employee
Go to Properties of your PC.
Go to Change settings
Go to Environment Variables
Go to Path in System Variables. Add Paths.
C:\Users\gunjansa\AppData\Local\Continuum\anaconda3
C:\Users\gunjansa\AppData\Local\Continuum\anaconda3\Library\mingw-w64\bin
C:\Users\gunjansa\AppData\Local\Continuum\anaconda3\Scripts
C:\Users\gunjansa\AppData\Local\Continuum\anaconda3\Library\bin
- HeliosOne6 years agoFrequent Visitor
Thank you guys for that explanation. You are real Python ninjas! 🙂
- jamesmkfoo6 years agoRegular Visitor
Thank you Sir gunjansa_ms! I solved it by adding anaconda3\Scripts and anaconda3\Library\bin to PATH variable.
- perezco6 years ago
Advocate III
providing that the variable path needto be add ...it is not enough explanation.
This how: https://www.h3xed.com/windows/how-to-add-to-and-edit-windows-path-variable
looks this HeliosOne link https://community.powerbi.com/t5/Desktop/error-Working-Directory-does-not-exit/td-p/676990
if you add them in the Path .. It start the python to work from Anaconda - dpy23104 years agoNew Member
I had already added these in environment variable PATH, I had another extra step was to start Power BI go to --> File --> Options and Settings --> Options --> Python scripting --> Change Detected Python IDEs: "Other" and select "C:\Users\<username>\Anaconda3\Scripts\conda.exe" ****Note: this path depends on where you installed conda.exe --> OK.
Restart Power BI and then any script works.
Thanks
- hmvinuezaB4 years agoNew Member
Thanks a lot, with this final step I fixed the issue.
- santoshkoirala6 years agoRegular Visitor
I spent a whole work day trying to debug/fix this issue. After a whole lot of reading posts on google, stack overflow and countless iteration of updating anaconda, uninstall/reinstall numpy, I stumbled across this post. Thanks gunjansa_ms for the workaround. Cannot believe it was as easy as adding a few environemntal variables. Hopefully the PowerBI team fixes this soon or update their documentation to set the path variable.
- nmckbcs5 years ago
Helper I
Can you guys provide specifically what had to be done here?
- Naveen_SV5 years ago
Helper IV
How to set this environment varaibles can you send me screenshot