'VS Code can't find Python and interpreter

I searched everywhere, but did not find an answer. Since I think the answers are outdated because they use python.pythonPath and this does not exist anymore. My problem is the following: enter image description here

But I installed [email protected] already via homebrew (I have a mac M1 with macOS Monterey). If I use ,,which python3'', I will get: enter image description here

And here you can see the output of ,,echo $PATH'': enter image description here

What should I do, so that the error message does not appear again??



Solution 1:[1]

You have to click on 'No Interpreter Selected' and then you can add a path to pythonenter image description here

If nothing else will work enter image description here

Go on terminal and write your python-path\python.exe python-file.y. If this works you can create a shell script inside of your folder and then put inside the python call. Then you can start your python file with the shell script.

Solution 2:[2]

You can go to the Extensions Library and download the Python Interpreter for VS Code. Make sure Python is installed on your PC.

If you still have problems, try reinstalling Python and VS Code.

Solution 3:[3]

I think the above two answers have been well analyzed. If you can't solve the problem, you can refer to the instructions of vsocde and reinstall python.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 BSMP
Solution 3 MingJie-MSFT