0
votes

I've got a project. Pycharm reports unresolved references, even though the code using these "unresolved" references works just fine.

I've tried invalidate cachces/restart, Mark directory as Project root - nothing works. The funny thing is that is happened after pycharm restart. I just restarted my IDE and got the issue.

From this picture it can be seen that all directories and init.py files are indeed in place.

enter image description here

2
which file is the one shown on the right side of the picture? - The4thIceman
this one is pipelines.py - drsealks
hmm. in my experience if the other file (items.py) is in the same directory as the file you are importing from (pipelines.py), then why would you need to put "from EchoMskCrawler.items"? would "from items" not be sufficient? - The4thIceman
Also, I am just a bit concerned about why there are two nested directories of the same name.... - The4thIceman
From the coloring, it looks like you have marked the inner EchoMskCrawler package as [re]sources root when the dotted paths of your imports indicate it should be the outer one. - schwobaseggl

2 Answers

1
votes

It seems there are two nested folders of the same name: EchoMskCrawler. And pycharm is getting confused. Also, you only need to put:

from items import....

because they are in the same directory

0
votes

If you are using Python 3 you should do it:

from .items import SingleIssueItem