1

Today after an update to PyCharm 2021.2.2 I found that some projects in my workspace were messed up, for example I see this:

enter image description here

Instead of this, that I was seeing before PyCharm update:

enter image description here

Is there any way to fix this?

bad_coder
  • 11,289
  • 20
  • 44
  • 72
smarie
  • 4,568
  • 24
  • 39

2 Answers2

1

(Answering my own question so as to save time for users facing the same issue.)

EDIT: found a more stable and faster solution.

In PyCharm > Settings > Project Structure, select the project and remove the useless "Content Roots" at the right on the screen.

enter image description here



Old solution for reference:

  • Close PyCharm.
  • Open the faulty project's <root>/.idea/<project>.iml and remove all XML entries that refer to content outside the project:

enter image description here

  • Save the file and reopen PyCharm. The project displays normally again.
bad_coder
  • 11,289
  • 20
  • 44
  • 72
smarie
  • 4,568
  • 24
  • 39
1

For me helped following:

  • Close PyCharm
  • (Optional) I've also removed the project from my "Recent Projects List"
  • Remove .idea folder from project root
  • Open the project and wait for indexing process
khashashin
  • 1,058
  • 14
  • 40