0

I get this error:

AttributeError: partially initialized module 'datetime' has no attribute 'datetime' (most likely due to a circular import)

Code:

import datetime as dt

now = dt.datetime.now()
print(now)

enter image description here

Nimantha
  • 6,405
  • 6
  • 28
  • 69
  • does your demo.py file is used by another files? the code you have attached should work. please also fix your question to look better: attach normally the image and put your code with code quotes. – a.k Jul 15 '21 at 12:19
  • I'm sorry it is my first-time post yes there no is a file named with the demo I make sure that even if I rename it as something like "jhbfdhfdsf" it's not working and giving me the same error – Arunodai kumar Jul 15 '21 at 12:27

1 Answers1

6

Look at the error carefully you have a file named datetime.py in your parent directory (32_automated_email).

Change the name and it will work fine. Don't name a file same as a python module.

Rishab Mamgai
  • 233
  • 3
  • 9