Tell PyCharm where to find my python modules?

I have a library that I wrote in Python that I use for almost all my projects. I have been using VS Code to work in Python, but I would prefer to use PyCharm. With VS Code, I simply create a ".env" file in each project directory with the following line in it...

PYTHONPATH="C:\Users\myname\Documents\VSCode Projects\lib2"

...and VS Code knows to look there when I try to import a module.


How do I accomplish the same thing in PyCharm? Can I set this as a default, or do I have to do it for each project?

Please sign in to leave a comment.