尝试在 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 但无济于事。
由于您使用的是 Anaconda Python 发行版,您可能非常清楚
你必须激活conda,
然后才能运行 PBIDesktop.exe。如果您想包含像 numpy 所需的 C 库,这一点尤其正确。
就这么简单。
我通过以下方式使用 conda 环境使其正常工作:
import os print("PYTHONPATH:", os.environ.get('PYTHONPATH')) print("PATH:", os.environ.get('PATH'))