简体   繁体   English

在 Power BI 中为 Python 脚本计划刷新时出错

[英]Error when scheduling refresh for Python script in Power BI

Hope to get some advice with Power BI schedule refershing Python script.希望通过引用 Python 脚本的 Power BI 计划获得一些建议。

I can run the Python script in Power BI successfully.我可以在 Power BI 中成功运行 Python 脚本。 I am using Anaconda environment and I do have issue before when running it directly in Power BI Python script.我正在使用 Anaconda 环境,并且在直接在 Power BI Python 脚本中运行它之前确实遇到了问题。 However, after following the artile, How to Get Started Using Python using Anaconda, VS Code, Power BI and SQL Server , which I find oneline, it now works.但是,按照文章, How to Get Started Using Python using Anaconda, VS Code, Power BI and SQL Server之后,我现在找到了。 I can run the script in Power BI Desktop successfully.我可以在 Power BI Desktop 中成功运行脚本。 The problem now is that when I try to automate the Python script using schedule refresh Gateway Personal mode connection, it pops up error again.现在的问题是,当我尝试使用计划刷新网关个人模式连接自动执行 Python 脚本时,它再次弹出错误。 Please see below for details.请参阅下面的详细资料。 I am using personal gateway.我正在使用个人网关。 I cannot find a solution online.我在网上找不到解决方案。 Could anyone let me know what is wrong with it?谁能让我知道它有什么问题? Thanks!谢谢!

Failed to update data source credentials: ADO.NET: Python script error.无法更新数据源凭据:ADO.NET:Python 脚本错误。 C:\Users\becky.lam\Anaconda3\lib\site-packages\numpy_ init _.py:143: UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. C:\Users\becky.lam\Anaconda3\lib\site-packages\numpy_ init _.py:143: UserWarning: mkl-service package 无法导入,因此英特尔(R) MKL 初始化确保其正确输出在 Gnu OpenMP 已经被 Python 进程加载的情况下,box 操作无法保证。 Please install mkl-service package, see http://github.com/IntelPython/mkl-service from.请安装 mkl-service package,参见http://github.com/IntelPython/mkl-service来自。 import distributor_init Traceback (most recent call last): File "C:\Users\becky.lam\PythonScriptWrapper_a418e530-37dc-4b01-9ce1-9ef57887a15a\PythonScriptWrapper.PY", line 2, in import os, pandas, matplotlib File "C:\Users\becky.lam\Anaconda3\lib\site-packages\pandas_ init .py", line 16, in raise ImportError( ImportError: Unable to import required dependencies: numpy: IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE. Importing the numpy C-extensions failed, This error can happen for many reasons. often due to issues with your setup or how NumPy was installed: We have compiled some common reasons and troubleshooting tips at: Please note and check the following: * The Python version is. Python3:9 from "C.\Users\becky.lam\Anaconda3\python:exe" * The NumPy version is. "1.20.3" and import distributor_init Traceback (most recent call last): File "C:\Users\becky.lam\PythonScriptWrapper_a418e530-37dc-4b01-9ce1-9ef57887a15a\PythonScriptWrapper.PY", line 2, in import os, pandas, matplotlib File "C: \Users\becky.lam\Anaconda3\lib\site-packages\ pandas_init .py",第 16 行,在引发 ImportError(ImportError:无法导入所需的依赖项:numpy:重要提示:请阅读此内容以获取有关如何解决此问题的建议ISSUE. Importing the numpy C-extensions failed, 这个错误的发生有很多原因。通常是由于您的设置问题或 NumPy 的安装方式问题:我们在以下位置编译了一些常见原因和故障排除提示:请注意并检查以下内容:* Python 版本是.Python3:9 from "C.\Users\becky.lam\Anaconda3\python:exe" * NumPy 版本是."1.20.3" 和make sure that they are the versions you expect.确保它们是您期望的版本。 Please carefully study the documentation linked above for further help: Original error was: DLL load failed while importing _multiarray_umath.请仔细研究上面链接的文档以获得进一步的帮助:原始错误是:DLL load failed while importing _multiarray_umath。 The specified module could not be found.指定的模块无法找到。 Hide details隐藏细节

I recommend you to unistall anaconda and use only the Python IDLE.我建议您卸载 anaconda 并仅使用 Python IDLE。 Set as path, open cmd then use: py -m pip install 'name of the packges'设置为路径,打开 cmd 然后使用: py -m pip install 'name of the packges'

Power Bi needs at least those ones: matplotlib numpy pandas os Power Bi 至少需要那些:matplotlib numpy pandas os

Then open Power Bi, go to: Options - Python Scripts -> Use the IDLE file (Eg: ./python310.py) as interpreter.然后打开 Power Bi,转到:选项 - Python 脚本 -> 使用 IDLE 文件(例如:./python310.py)作为解释器。

If more libraries are needed the Power Bi Desktop will tell you.如果需要更多库,Power Bi Desktop 会告诉您。 Use the previous process to install then.然后使用前面的过程进行安装。

This should solve the problem.这应该可以解决问题。

Firstly, check whether the below steps were followed: Consider a dataset (bring the raw data) into power bi desktop -> get data -> hit web -> paste the URL of the google sheet -> copy the link首先,检查是否遵循以下步骤:考虑一个数据集(将原始数据)放入power bi桌面 -> 获取数据 -> 点击 web -> 粘贴谷歌表的 URL -> 复制链接

A connection will be established between the report in our power bi service to the spreadsheets in google sheets.将在我们的 power bi 服务中的报告与 google 表格中的电子表格之间建立连接。

Data can be in the form of Google sheet (or) CSV files数据可以是 Google 表格(或)CSV 文件的形式

Ensure that the link provided on the web should be correct.确保 web 上提供的链接正确无误。

So let's bring in the table -> load it -> create a dashboard to determine the data distribution -> save the report -> publish it in my workspace into the service.所以让我们引入表格 -> 加载它 -> 创建仪表板以确定数据分布 -> 保存报告 -> 在我的工作区中将其发布到服务中。

Now we have the power bi report that we created for our service and we will be able to see our dashboard in the workspace.现在我们有了为我们的服务创建的 power bi 报告,我们将能够在工作区中看到我们的仪表板。

To validate go to data sets -> click the ellipsis icon -> settings -> data sets.要将 go 验证为数据集 -> 单击省略号图标 -> 设置 -> 数据集。

We need to make sure that the data source credentials are okay.我们需要确保数据源凭据正常。

In power bi reports -> open the data set -> hit refresh now -> just refresh the visuals and it should update things automatically.在 Power bi 报告中 -> 打开数据集 -> 现在点击刷新 -> 只需刷新视觉效果,它应该会自动更新内容。

Schedule Refresh - we wanted to just refresh based on the schedule that we set.计划刷新 - 我们只想根据我们设置的计划进行刷新。 Settings menu -> data sets -> settings -> schedule refresh (expand it) now it's off by default and it won't let you turn it on unless you have no issues with the data source credentials.设置菜单 -> 数据集 -> 设置 -> 计划刷新(展开)现在默认情况下它是关闭的,除非您对数据源凭据没有任何问题,否则它不会让您打开它。 everything needs to be okay there and once that's all okay -> toggle the on so that allows you to refresh your reports based on the scale to reset(Daily or Weekly).那里的一切都需要正常,一旦一切正常-> 将其打开,以便您可以根据要重置的规模(每天或每周)刷新报告。

Under the Scheduled Refresh -> Refresh Frequency Here we have a few options to set the refresh frequency to daily or weekly.在 Scheduled Refresh -> Refresh Frequency 下,我们有几个选项可以将刷新频率设置为每天或每周。

Daily - Refresh Frequency within a day can be set up to eight times.每日 - 一天内的刷新频率最多可设置八次。 we can add up to eight different entries here.我们可以在这里添加多达八个不同的条目。

Under send refresh failure notifications we can select the dataset owner or certain people if there are any issues with refreshing your report maybe there are some problems with the google sheet maybe it's been deleted or edited the wrong way and the refresh fails when that happens an email gets sent to the people based on the option we have opted saying that there is a problem and what kind of problem it is.在发送刷新失败通知下,我们可以 select 数据集所有者或某些人,如果刷新您的报告有任何问题,也许谷歌工作表有一些问题,也许它被错误地删除或编辑,刷新失败时发生这种情况 email根据我们选择的选项发送给人们,说明存在问题以及它是什么类型的问题。

The automated system is really handy to monitor any issues.自动化系统非常方便监控任何问题。

I hope my answer will help you, for any further issues please feel free to reply.希望我的回答对你有帮助,有其他问题欢迎回复。 Contributors from KLH: 2010030362,2010030550 KLH 贡献者:2010030362,2010030550

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM