How do I configure a Python interpreter in IntelliJ IDEA with the PyCharm plugin? How do I configure a Python interpreter in IntelliJ IDEA with the PyCharm plugin? python python

How do I configure a Python interpreter in IntelliJ IDEA with the PyCharm plugin?


With the Python plugin installed:

  1. Navigate to File > Project Structure.
  2. Under the Project menu for Project SDK, select "New" and
  3. Select "Python SDK", then select "Local".

Provided you have a Python SDK installed, the flow should be natural from there - navigate to the location your Python installation lives.


So here is a simple project, where I have used Selenium and added that using external path

Error

Now you need to open Project Structure and go to SDK Section

Project Structure

Now Select your project's virtual environment. In the Classpath tab add the PYTHONPATH by clicking + button

Add SDK

and now the modules will be recognized

Module recognized


I was getting the error (IntelliJ on Ubuntu 18.04) while python SDK was configured.

To fix that, I had to do this:

  1. File -> Project Structure -> Modules
  2. Click on the Dependencies tab, and click on + and select the python SDK

    enter image description here

  3. Click on Apply

After that, the warning went away and autocompletion also started working properly