There is a tutorial in the IDEA docs on how to add a Python interpreter in PyCharm, which involves accessing the “Project Interpreter” page. Even after installing the Python plugin, I don’t see that setting anywhere.
Am I missing something obvious?
With the Python plugin installed:
- Navigate to File > Project Structure.
- Under the Project menu for Project SDK, select “New” and
- 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
Now you need to open
Project Structure and go to
Now Select your project’s virtual environment. In the
Classpath tab add the
PYTHONPATH by clicking
and now the modules will be recognized
I was getting the error (IntelliJ on Ubuntu 18.04) while python SDK was configured.
To fix that, I had to do this:
Click on the
Dependenciestab, and click on
+and select the python SDK
After that, the warning went away and autocompletion also started working properly
If you have multiple modules in your project, with different languages, you can set the interpreter in the following way:
File -> Project Structure...
Modulesin the list on the left
- Select the Python module in the list of modules
- On the right-hand side, either choose an existing Python SDK from the dropdown list, or click on the
New...button to create either a virtualenv, or create a new Python SDK from a Python installation on your system.
Follow these steps:
- Open Setting (Ctrl + Alt + s)
- Click on plugins
- Find Browse Repositories and click
- Search for “python”
- Select Python SDK or pycharm
- Restart the IDE
- Go to project structure
- Select the python SDK in projects or create a new project with python SDK.