0

I use Pycharm, and whenever I move a project to another folder, it says "invalid python interpreter selected for the project". I think it happens because the path to venv has changed.

I tried Configure Python Interpreter > Add Interpreter > Select "Existing Environment" with the new path to venv. I was expecting this to work, but after I click OK, it says "Updating interpreter path" for a moment, and nothing changes. How can I fix this?

ssamtkwon
  • 29
  • 7
  • This is a documented restriction in `virtualenv`; it doesn't cope with having its directory renamed because the generated environment contains the hardcoded path in several places. Throw away the old env and create a new one, or move it back (and think about how to get yourself out of hhe corner you painted yourself into by other means) if that's not feasible. – tripleee Mar 12 '21 at 12:53
  • Thank you, I actually tried deleting and creating it again, but I still could not get pycharm to select the new environment. – ssamtkwon Mar 12 '21 at 13:06
  • I think I solved it. Not sure if this is the right way, but checking "make available to all projects" seems to work. – ssamtkwon Mar 12 '21 at 13:14

0 Answers0