简体   繁体   中英

Error while running python script in power bi desktop

'm trying to use python scripting in power bi. I am referring documentation: here and here ;

also confirming of installing appropriate packages in the folder, 在此处输入图像描述

Identifying directory using where python and my installation directory is C:\USERS\ABC\ANACONDA3

在此处输入图像描述

I am using an example script provided here

    import pandas as pd 
df = pd.DataFrame({ 
    'Fname':['Harry','Sally','Paul','Abe','June','Mike','Tom'], 
    'Age':[21,34,42,18,24,80,22], 
    'Weight': [180, 130, 200, 140, 176, 142, 210], 
    'Gender':['M','F','M','M','F','M','M'], 
    'State':['Washington','Oregon','California','Washington','Nevada','Texas','Nevada'],
    'Children':[4,1,2,3,0,2,0],
    'Pets':[3,2,2,5,0,1,5] 
}) 
print (df)

Please help in resolving below error, 在此处输入图像描述 在此处输入图像描述 在此处输入图像描述

Looks like you don't have panda installed.

You could first check in your C:\Users\abc\AppData\Local\Programs\Python\Python39\Lib\site-packages that you indeed have the panda package available.

If not, you can install it using this command: py -m pip install pandas

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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