I re-installed windows and opened an existing Pycharm project and get the error \'SDK seems invalid\' in Settings > Project Interpreter.
The project interpreter path
Most probably, some path to Python environment that PyCharm tries to use has become invalid somewhere. There are (at least) two primary suspects:
PyCharm needs to know the path to your environment to run things in it. So, if that path changed, PyCharm's saved path has become invalid.
Go to the interpreter settings for your project in File->Settings...->Project interpreter->(Gear icon)->Show all...
:
Then delete and recreate the necessary entries. Or edit them and specify correct paths. E.g. this is what my list looks like after I deleted an Anaconda installation:
Since virtualenv is not a full installation, it must have a path to its base installation stored somewhere to be able to use files from there.
As of this writing, virtualenv
(v16.0.0
) in Windows is implemented like this:
python.exe
and several other files are copied into the virtualenv's subtreeLib\orig-prefix.txt
, the path to the base installation is stored. It is used to add the base installation's Lib
to sys.path
via a custom site.py
.So, if the path in that file becomes invalid, the virtualenv's Python interpreter will be unable to find any standard modules except those few that were copied. Which perfectly fits your symptoms.