I was trying to mark a directory as test sources root in PyCharm so that I don't have to manually set the target directory for my generated test file every time. When I right-click my "tests" directory I only see the following four options:
Mark Directory As: 1. Source Root 2. Template Folder 3. Excluded 4. Resource Root
I remember doing this in Intellij for Java but is this not possible for PyCharm?
In Pycharm, if you right click in a folder inside your project, you can mark it as sources root , so then you can import modules from this folder and subfolders.
Once PyCharm is open, set up the project. Go to File->Open and select the root directory in which both your source and build directories reside.
The project source directory is typically the topmost, or “root” directory that contains most of the source files. You might think of this as the “home” directory of the project. Source Insight normalizes project file names relative to this directory.
Do the following:
<project root>/.idea/<projectname>.iml
file in a text editor. If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With