My project is stored in a certain directory which I'll call .../programs/mine, and its source files are in .../programs/mine/src. It uses some common modules that are stored in .../programs. This poses two problems. First: importing the modules so that the program can call them. Second: telling PyCharm that .../programs is a content root so that it won't flag every import statement as an error.
I know how to solve the first problem, but the second one baffles me. When I try to declare .../programs as a content root, PyCharm displays the message:
Content root being added ".../programs" dominates existing content root "...programs/mine/src". Content roots should not intersect.
I'm puzzled by two things. First, what is the reason for this limitation? If Python searched the directory tree below a directory in the Pythonpath it would make some sense (although it would not be necessary, and I could argue that it prevented the programmer from doing some useful things). Python doesn't work that way, though, and I can think of no reason why PyCharm should.
Second, how can I make PyCharm work with my application? Moving the modules out of .../programs is not an option; they were here before I was, and a dozen or more programs depend on them. But I'm not pleased by the idea of just putting up with a bunch of false error messages because my IDE is too inflexible to accommodate to the environment it runs in.