Reputation: 483
Error
Details: "ADO.NET: Python script error.
<pi>Traceback (most recent call last):
File "PythonScriptWrapper.PY", line 2, in <module>
import os, pandas, matplotlib
ModuleNotFoundError: No module named 'pandas'
</pi>"
I have imported data into PowerBi, I am now trying to execute some python script on the imported data, but I get the above error.
Please note that I have installed both numpy and pandas through the pip install function in cmd.
Also note that I am not using anaconda, I have installed python directly on my machine (most of the threads I've looked at reference solutions that are to do with Anaconda).
Thanks
Upvotes: 0
Views: 1835
Reputation: 21
Install python latest version using https://www.python.org/downloads/ In cmd, verify python installation using command ‘python –version’ Then install os,pandas,matplotlib,numpy using pip install. import and load the required dataset in Powerbi Desktop. We can also create visualization graphs and plots using python script. in visualizations tab, select python visual(PY) and select required fields from the dataset. a python script editor will be displayed. For example, We used Iris dataset The following code to create a dataframe and remove duplicated rows is always executed and acts as a preamble for your script:
dataset = pandas.DataFrame(Species, Id, PetalLengthCm, PetalWidthCm, SepalLengthCm, SepalWidthCm) dataset = dataset.drop_duplicates()
import matplotlib.pyplot as plt
ax=plt.gca()
dataset.plot(kind='line',x='Species',y='SepalLengthCm',color='blue',ax=ax)
plt.show()
Upvotes: 1