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 t
Just create and add Python SDK
File -> Project Structure -> Project -> Project SDK -> new
and select the installation path of your Python interpreter (for
example, C:\Python26
in windows and /usr/bin/python2.7
in Linux) as the home path.
Related discussion: http://devnet.jetbrains.net/thread/286883
If your Python SDK is properly configured and you are still facing the problem that builtins are not recognized, try this:
File -> Invalidate Caches/Restart
Use a Requirements File (see link to JetBrains documentation)
In my case I needed arrow
. So, I added
arrow==0.7.0
to my projects requirements.txt
Then Intellij prompted me to add the library the first time that I wrote import arrow
in a Python script
Even my Intellisense in Pycharm was not working for modules like time Problem in my system was no Interpreter was selected Go to File --> Settings... (Ctrl+Alt+S) Open Project Interpreter
Project Interpreter In my case was selected. I selected the available python interpreter. If not available you can add a new interpreter.
I got it to work after I unchecked the following options in the Run/Debug Configurations for main.py
Add content roots to PYTHONPATH
Add source roots to PYTHONPATH
This is after I had invalidated the cache and restarted.
(solved my problem) File -> Project structures -> Modules -> Add (small plus sign) -> Import Module -> Add the path contains the files (e.g. src/mymodule) -> Create Module from existing sources -> Next -> next -> Finish. You should see a file with .iml in the directory where you cannot imoport; that should do the trick