You have to tell Pycharm to use Project A as another "Content Root" for Project B.
- From the upper bar, go to File -> Settings... -> Project: [yourprojectnamehere] -> Project Structure.
- Click on
+ Add Content Root
at the right panel
- Select the Project A folder from the popup named
Select content root directory
- Click OK
Now, you'll see Project A is listed at the right panel.
- Click on Project A from the right panel
- Now, the content of project A is listed. Select the ones you want to be included as source. You can hold
Ctrl
and click left mouse button
to select multiple entities.
- Click
Sources
from the upper bar to assign the selected entities as Source.
Now you should see Source Folders at the right panel.
UPDATE: As of at least Pycharm 2019.1.3, this seems to have changed, to be simpler thankfully.
- From the upper bar, go to File -> Settings... -> Project: [yourprojectnamehere] -> Project Dependencies.
- Select your project, and then click the checkboxes for each other project it's dependent on.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…