Pycharm list package but mark import as unresolved reference
Hello all,
I have found topics on similar issues, and tried invalidating the cache/restarting, but for some packages, i.e., flask_login I have this weird issue where pycharm actually lists the package in the settings dialog but still shows unresolved reference on import and does not autocomplete attributes.
Any idea how to fix that?

Please sign in to leave a comment.
Does the code actually run? If so, please try File | Invalidate cache/restart , and make sure correct interpreter is selected for this project.
The code runs, in the same virtualenv and I tried invalidating the cache already.
Thanks,
Can you please provide screenshot of the whole IDE window with the project structure visible? It may give some hint at what's wrong.
You pointed me in the right direction: my project structure is a mess. I had a subproject inside a main project. The main project was configured for a condaenv. It had a subproject in its tree that was supposed to use a distinct virtualenv.
I thought I could easily switch interpreters but for some reason, even if the interpreter name in the status bar of pycharm was changing, the interpreter in use was still the one of the main project. As a workaround, I just removed all the messy .idea folders, and I will stick to one pycharm project/one interpreter, which seems to have solved the issue for me. Thanks!
Yes, one interpreter per project is how PyCharm (and Python in general) was designed. If you need to use different interpreters, you can create multiple projects, and then attach them to one window: https://www.jetbrains.com/help/pycharm/opening-multiple-projects.html