How do I get IntelliJ to recognize common Python modules?

I’m using IntelliJ 10 IDEA Ultimate Edition.

I’ve created a new file Test.py, and IntelliJ has correctly switched to Python parsing mode. (I can confirm this by typing “d”, it pops up “def” as a suggestion, and hitting tab correctly gives me “def :”)

However, when I try this code…

import os

cwd = os.getcw <Ctrl-space>

Two things happen….

  1. I get a squggly underline underneath os and hovering over it gives me a “Unresolved reference ‘os'” message
  2. I get no suggestions hitting Ctrl-space above, when I’m expecting to see “getcwd”.

I’m assuming that this must be a result of my not configuring IntelliJ properly in order to handle python modules, but I have no idea what it is I’m missing.

Any IntelliJ/Python users able to help me out?

13 Answers
13

Leave a Comment