PyCharm not resolving import

Completed

Pycharm is consistently not resolving the "baselines" import (but it runs fine).  I'm really not sure why!

 

 

What I've tried:

The parent directory is marked as a sources root, and sources are added to the PYTHONPATH:

I did "pip install -e", and pip lists baselines as installed:

I collect type information, in case this also collects info about imports.

 

4 comments

Hi,

Looking at the screenshots, marking baselines directory as Sources should do the trick or using the whole path (bacelines.baselines.).

Could you please upload your sample project and idea.log (Help | Show Log in...) zipped to https://uploads.services.jetbrains.com/ and let me know the name of that zip file?

0

Thanks.  I tried marking baselines directory as source root, however it still does not work

I've reproduced the issue in dummy projects I just made.  The issue seems to relate to having 2 projects in the same window, and the sources root only applies within a project (?).  How to make PyCharm resolve imports from another project?  I uploaded this as pycharm_unresolved.zip


 

 

0

Thanks!  I detached the baselines project, then added it as a content root (and then a source directory) of my other project, and now the imports resolve.

0

Please sign in to leave a comment.