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
Have you set up a python interpreter facet?
Open Project Structure CTRL+ALT+SHIFT+S
Project settings -> Facets -> expand Python click on child -> Python Interpreter
Then:
Project settings -> Modules -> Expand module -> Python -> Dependencies -> select Python module SDK
This is how i solved my problem (i have imported the project and it was showing there only, newly created files were not showing those errors):
1) Command + alt + R (Control in case of windows
2) Debug window will appear, select your file and press right arrow (->) and choose Edit then press enter (Edit configuration setting window will appear)
3) Under configuration, at the bottom you can see the error (please select a module with a valid python sdk), So in Python Interpreter, check Use Specified Interpreter, then in drop down you select your Python version
(In case python is not there download python plugin for intelliJ using following link https://www.jetbrains.com/help/idea/2016.3/installing-updating-and-uninstalling-repository-plugins.html
4) Click on apply then close it.
Bingo it's done.
Few steps that helped me (some of them are mentioned above):
Open project structure by:
command + ; (mac users)
OR
right click on the project ->
Open Module Settings
->
+ ->
Python ->
<your-project> ->
OK->
Python ->
<select python interpreter>->
Project SDK ->
<select relevant SDK>->
<make sure it's the right one>Click OK
.
Open Run/Debug Configurations by:
Run ->
Edit Configurations
->
<make sure it's the right one> Click OK
.
You might have configured the environment properly but for some reason it broke along the way. In this case go to:
file > project settings > modules
Deploy the list of SDKs and look for a red line with [invalid]
at the end.
If you find one, you have to recreate a python sdk.
It is likely that your previously working SDK is there too, but not red. Delete it.
Now you can click on the new
button and add your favorite python virtualenv. And it should work now.
Here's what I had to do. (And I probably forgot an important aspect of my problem, which is that this wasn't set up as a Python project originally, but a Java project, with some python files in them.)
Project Settings -> Modules -> Plus button (add a module) -> Python
Then, click the "..." button next to Python Interpreter.
In the "Configure SDK" dialog that pops up, click the "+" button. Select "Python SDK", then select the default "Python" shortcut that appears in my finder dialog
Wait about 5 minutes. Read some productivity tips. :)
Click Ok
Wait for the system to rebuild some indexes.
Hooray! Code hinting is back for my modules!
My problem was similar to @Toddarooski 's, except that the module I had, under the "Dependencies" tab, had no SDK listed. I right clicked on 'SDK', picked edit from the drop down menu, and selected my Python SDK. That did the trick.