PyCharm warns for unresolved reference builtin datetime module

Question:

I just installed the latest version of PyCharm (4.5).

Now I am experiencing unresolved reference errors.
On the top of my code I have:

from datetime import datetime

OS is Ubuntu 15.04.
Already did the Invalidate Cache/Restart several times. No difference.
The Project interpreter of my project is set to Python 2.7.6.
Already reloaded the Interperter Paths.

Code works fine, it’s just the IDE that produces an annoying error and no more autocomplete.

Asked By: stijnh92

||

Answers:

That’s a known, already reported at https://youtrack.jetbrains.com/issue/PY-15460

Answered By: sorin

As mentioned here try to delete the content of the skeleton folder. It reside inside of the settingsfolder (~/.PyCharmxxxx.xx/system/python_stubs)
Removing/adding the python environment was not necessary for me. Simply restart PyCharm after removing the content (or the whole python_stubs folder)

This does the trick for me and now it works like a (py)charm again.

Answered By: user762353

Instead of

import datetime

Try this

from datetime import datetime

Works for me.

Answered By: exe
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.