Unresolved reference with 2018.1 version


Hello, since I installed the 2018.1 version of pycharm, all my Django projects have problems of imports. The projects still work, but in the IDE I have the error "Unresolved reference xx". I tried a little everything I found on the internet but without success. Can you help me please ?


Hm, that's interesting, thank you! Why do you mark the project root as a source root? PyCharm adds it to the PYTHONPATH by default so I believe there's no need for such customization.

Could you please Ctrl+click on creapole in from creapole import creapole_vars? What file get opened? Could you please also take a screenshot of Settings | Project ... | Project Structure?

I created a ticket for this problem: PY-29330. Please attach idea.log from Help | Show Log in ... there.


Ok, I put the root project in source root because I tried many solutions to solve my problem and I did not cancel my changes.


Could you please Ctrl+click on creapole in from creapole import creapole_vars? What file get opened?

When I do the ctrl + click it opens the file creapole / creapole / __ init__.py
The project structure (deleted the line for the root source):

I'm seeing a similar issue (though with non-Django projects).

Before the upgrade everything worked fine in 2017. Now, imports resolve, but references to items in imported modules do not.

I am using a Virtualenv, which is configured in the Project Structure settings. I have also marked my "Sources Root" correctly. 

Note that I have tried recreating the Virtualenv in IDEA as well as Invalidating Caches / removing .idea directory and reconfiguring project.


Hi Mmick! Could you please provide an example of such false positive error?

Hi, thank you for your answer. 
Some import works others not, here are some screenshots:


Same happens to me in Intellij IDEA 2018.1

Only full-path import works, __init__.py is not taken into account, similarly if module `a` imports something from module `b` as `C`, `from a import C` shows false-positive IDE error.

I also noticed it may work for some time after restart and some indexing but after a while it's broken again. I've multiple modules in my project that share same SDK. Also It's very strange that error shows cannot find <something> in <module> | <module> | <module> where module is always same.


For unresolved references in Python plugin please follow PY-29338. We are investigating the problem, I am sorry for the inconvenience!


Please sign in to leave a comment.