Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get IntelliJ to recognize common Python modules?

People also ask

How do I import a Python module into IntelliJ?

To do so, open the terminal in IntelliJ and run the activate command. IntelliJ will complain that there is no module named bs4 . Move the cursor to this name and press Alt-Enter. There should be an option to install the module.

Where are default Python modules installed?

Usually in /lib/site-packages in your Python folder.

How do I enable Python in IntelliJ?

Navigate to File | Project Structure Ctrl+Alt+Shift+S . , and from the popup menu, choose Python SDK. In the left-hand pane of the Add Python Interpreter dialog, select System Interpreter. and in the Select Python Interpreter dialog that opens, choose the desired Python executable and click OK.

How do I see all Python modules?

To check all the installed Python modules, we can use the following two commands with the 'pip': Using 'pip freeze' command. Using 'pip list command.


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


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


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

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!