- 에러 메시지
"Python is not installed." Please download and install Python before using the extension.

    - 증상
파이썬 코드가 제대로 정상 작동하고 모듈도 설치되어 있는데도
Import "numpy" could not be resolved  Pylance(reportMissingImports) 
의 에러 메시지 발생하고, 
또 Visual Studio Code 실행후에 Python 파일을 로드하면 파이썬이 설치되어 있지 않다고 에러 메시지 발생하는 상황


    - 원인
파이썬을 버전을 변경하고 이전 폴더가 없어진 경우(또는 비정상 삭제)
VS Code의 Python Extension이 제거된 파이썬 폴더를 찾고 있는 상황


    - 해결 방법1
VS Code의 Python Extension을 재설치(제거후 설치)

 

//-----------------------------------------------------------------------------
방법2
vs code 설정 - Python: Select Interpreter
https://code.visualstudio.com/docs/python/python-tutorial#_select-a-python-interpreter

Command Palette (Ctrl+Shift+P) 
-> Select Interpreter 입력 후 선택 
-> Python 경로 선택

 

 

 

반응형
Posted by codens