Hi Team,
trying to develop wordcloud from python script and using Uipath ‘Run python Script’ activity.
But unable to get the output. Following code when i ran from pycharm gives me out put as .png file in desired folder…
Same when i ran from uipath gives me nothing and even no error.
For python scope i have given desired folder path where python_35.exe exist. I also checked normal operation like writing into notepad that worked fine from uipath but when i run following code to generate wordcloud it gives no output.
Is it Uipath doesn’t support it:
#----------------------------python code starts here------------------------------------------
from wordcloud import WordCloud, STOPWORDS
import matplotlib.pyplot as plt
import pandas as pd
df = pd.read_csv(r’C:\temp\eminem.csv’, encoding =‘latin-1’)
comment_words = ’ ’
stopwords = set(STOPWORDS)
for val in df.CONTENT:
val = str(val)
tokens = val.split()
for i in range(len(tokens)):
tokens[i] = tokens[i].lower()
for words in tokens:
comment_words = comment_words + words + ’ ’
wordcloud = WordCloud(width = 800, height = 800,
background_color =‘white’,
stopwords = stopwords,
min_font_size = 10).generate(comment_words)
plt.figure(figsize = (8, 8), facecolor = None)
plt.imshow(wordcloud)
plt.axis(‘off’)
plt.tight_layout(pad = 0)
plt.savefig(‘C:\temp\uipathread.png’)
#----------------------------python code ends here------------------------------------------
My python installed in default path of
C:\Users\myname\AppData\Local\Programs\Python\Python35
And i am having all required pckg as well:
python -m pip install --upgrade pip (this i upgraded before downloading below two)
python -m pip install wordcloud
python -m pip install pandas