Friday, 28 September 2018

'Cannot setup a Python SDK' for existing PyCharm project

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 is pointing to python in the venv:

MyProject\venv\Scripts\python.exe

enter image description here

I tried re-adding python.exe:

enter image description here

Thats when I get the error:

enter image description here

Update: here is an error from idea.log, a lot of other issues for virtual environments seem to be with windows environment variables and system paths:

2018-09-28 19:50:40,275 [  17601]   INFO - hon.packaging.PyPIPackageCache - Loaded 153296 packages from C:\Users\Matt\.PyCharm2018.2\system\python_packages\pypi-cache.json 
2018-09-28 19:50:40,816 [  18142]   INFO - rains.python.sdk.PythonSdkType - Fatal Python error: Py_Initialize: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00000fa8 (most recent call first):

Exit code -1073740791 
2018-09-28 19:50:40,816 [  18142]  ERROR - ns.python.sdk.PythonSdkUpdater - Failed to determine Python's sys.path value:
STDOUT: 
STDERR: Fatal Python error: Py_Initialize: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00000fa8 (most recent call first):

com.jetbrains.python.sdk.InvalidSdkException: Failed to determine Python's sys.path value:
STDOUT: 
STDERR: Fatal Python error: Py_Initialize: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'



from 'Cannot setup a Python SDK' for existing PyCharm project

No comments:

Post a Comment