尝试在 Power BI 中运行 Python 脚本时出错

问题描述 投票:0回答:2

尝试在 power BI 中运行 python 脚本时,我不断收到以下错误。 我尝试卸载并重新安装所有 numpy 、 pandas 但无济于事。

请提供一些帮助以使其运行

,我将不胜感激
DataSource.Error: ADO.NET: Python script error.
<pi>C:\Users\User\anaconda3\lib\site-packages\numpy\__init__.py:148: 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. Please install mkl-service package, see http://github.com/IntelPython/mkl-service
  from . import _distributor_init
Traceback (most recent call last):
  File "C:\Users\User\PythonScriptWrapper_6bb79068-43bc-4932-896d-bb3c9e1e2a45\PythonScriptWrapper.PY", line 2, in <module>
    import os, pandas, matplotlib
  File "C:\Users\User\anaconda3\lib\site-packages\pandas\__init__.py", line 16, in <module>
    raise ImportError(

我尝试卸载并重新安装所有 numpy 、 pandas 但无济于事。

python machine-learning powerbi powerquery data-cleaning
2个回答
0
投票

由于您使用的是 Anaconda Python 发行版,您可能非常清楚

你必须激活conda

然后才能运行 PBIDesktop.exe。如果您想包含像 numpy 所需的 C 库,这一点尤其正确。

就这么简单。


0
投票

我通过以下方式使用 conda 环境使其正常工作:

  1. 使用MS指定的版本创建conda环境
  2. 在 vscode 中激活环境并创建一个 python 文件来列出 PATH:

import os print("PYTHONPATH:", os.environ.get('PYTHONPATH')) print("PATH:", os.environ.get('PATH'))

  1. 将与环境相关的多个路径添加为环境变量
© www.soinside.com 2019 - 2024. All rights reserved.