0

For some reason, whenever I try to import the datetime module, I am unable to do so on whatever text editors I use, I tried it on sublime, VScode, Atom, but I always get the same ImportError.

But if I try using it on Jupiter Notebook, it works pretty fine. No issues at all.

I just can't figure out why that happens:

error

I get the same error on every text editor I use, also, if I try to check the available functions on the datetime module, on VScode, it seems like it is empty:

error

but on jupyter notebook, it just works fine:

error

I installed python on my machine Using Anaconda.

Anyone has any idea of why that happens?

Chris
  • 112,704
  • 77
  • 249
  • 231
  • [Please don't post screenshots of text](https://meta.stackoverflow.com/a/285557/354577). They can't be searched or copied and offer poor usability. Instead, paste the code as text directly into your question. If you select it and click the `{}` button or Ctrl+K the code block will be indented by four spaces, which will cause it to be rendered as code. – Chris Aug 29 '20 at 14:40
  • Have you created your _own_ file (perhaps the one you're editing) called `datetime.py`? – Chris Aug 29 '20 at 14:40
  • yes, the file is called datetime.py, now that you just said it I may be importing my own empty file. – Alojarf Aug 29 '20 at 14:53
  • Yes, that's what's happening – Chris Aug 29 '20 at 14:54
  • it does, thanks a lot bro – Alojarf Aug 29 '20 at 15:04

0 Answers0