web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Trying to get this pyt...
Power Automate
Unanswered

Trying to get this python script to run but running into issues

(0) ShareShare
ReportReport
Posted on by 2

Hello!

 

I am try to run the following script:

from datetime import datetime
from dateutil.relativedelta import relativedelta
# current dateTime
now = datetime.now()
previousmonth = datetime.now()-relativedelta(months=1)

short_mon = previousmonth.strftime("%%b")

print(short_mon)

 When I run the code I get:

Traceback (most recent call last):
File "<string>", line 2, in <module>
ImportError: No module named dateutil.relativedelta

Is there a way to add this to powerautomate so that it can function?

 

I have the same question (0)
  • Verified answer
    Henrik_M Profile Picture
    2,021 Super User 2024 Season 1 on at

    Not sure. PAD runs an ancient version of Python, so that module is probably not included.

    However, I do know that you can achieve a similar result using three actions within PAD:

    1. Get current date and time
    2. Add to datetime
    3. Convert datetime to text

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard