This is the massage that Pycharm gives me almost once a day, and I have to restart it. As I have multiple projects open, it gives this error for each virtualenv repeatedly until I force quit it.
Is there a way to prevent Pycharm from constantly invalidating cache?
#ps: I never had such issues with Pycharm on Windows
Invalid Python SDK
Cannot set up a python SDK at Python 3.9 (demographics-g5XoraTQ) (/Users/mamad/Library/Caches/pypoetry/virtualenvs/up-demographics-g5XoraTQ-py3.9/bin/python). The SDK seems invalid.
It turns out the issue was the number of git repositories each with a separate project SDK (i.e. venv interpreter) that I had simultaneously opened in my PyCharm instance (over 10).
The re-indexing of git caches and Python libraries created memory issues and eventually resulted in corruption of index files; this couldn't be solved unless I restarted my PyCharm instance once a day.
The solution was to:
.venv
inside the project folder; so interpreter and project both can be removed in a single command.One undesirable outcome of the second solution is that my shell now displays one venv
name for all my virtual environments in all project folders.