Add Path to Project in PyCharm

Contents
Introduction
Add path to project
Related articles

Intro

In this article you can learn how to manually add paths to the PyCharm interpreter.

Add path to project

In order for PyCharm to find all parts of the project, you need to add the path to the root directory to the interpreter.

The interpreter is usually listed in the lower right corner.

I also recommend making sure that the directories contain the files __init__.py - despite the fact that some sources say that its presence is not necessary, I still see a difference in the behavior of PyCharm.

If PyCharm opens an empty directory or a directory without a virtual environment, it will automatically connect to a default interpreter of the following type:

C:\Users\User\AppData\Local\Programs\Python\Python312\python.exe

Adding a path to a project in PyCharm image from the site www.aredel.com image from www.aredel.com website
PyCharm
https://aredel.com

If a virtual environment has already been created in the directory, PyCharm will pick it up by default. Then the path to Python will be something like this:

C:\DEV\pych_path_demo\venv\Scripts\python.exe

Adding a path to a project in PyCharm image from the site www.aredel.com image from www.aredel.com website
PyCharm
https://aredel.com

By default, importing modules should work by listing directories through a dot

Adding a path to a project in PyCharm image from the site www.aredel.com image from www.aredel.com website
PyCharm
https://aredel.com

If for some reason the modules are not found, you can add the project root or another directory to the interpreter path.

First, you need to click on the lower right corner.

Adding a path to a project in PyCharm image from the site www.aredel.com image from www.aredel.com website
PyCharm
https://aredel.com

Then select the desired interpreter

Adding a path to a project in PyCharm image from the site www.aredel.com image from www.aredel.com website
PyCharm
https://aredel.com

Expand list of interpreters

Adding a path to a project in PyCharm image from the site www.aredel.com image from www.aredel.com website
PyCharm
https://aredel.com

Select Show All…

Adding a path to a project in PyCharm image from the site www.aredel.com image from www.aredel.com website
PyCharm
https://aredel.com

Expand tree

Adding a path to a project in PyCharm image from the site www.aredel.com image from www.aredel.com website
PyCharm
https://aredel.com

Click +

Adding a path to a project in PyCharm image from the site www.aredel.com image from www.aredel.com website
PyCharm
https://aredel.com

Specify the path and click OK

Adding a path to a project in PyCharm image from the site www.aredel.com image from www.aredel.com website
PyCharm
https://aredel.com

The path will appear in the list with the remark added by user

Adding a path to a project in PyCharm image from the site www.aredel.com image from www.aredel.com website
PyCharm
https://aredel.com
Related Articles
PyCharm: IDE
Install
Add Path to Project
Editor Basics
Python
Add Selenium to PyCharm

Search on this site

Subscribe to @aofeed channel for updates

Visit Channel

@aofeed

Feedback and Questions in Telegram

@aofeedchat