I think I'm having path related issues on VSCode.
I completely removed and reinstalled reinstalled the OS, I have Monterey 12.3.1
I installed Python using brew:
➜ ~ python3 --version
Python 3.9.12
➜ ~ which python3
/usr/local/bin/python3
However I have issues normally running my code on the mac. I can run from the terminal using
➜ test Python3 test.py
Hello World!
but if I try to run using right-clic -> run, I get:
[Running] python -u "/Users/user/Desktop/test/test.py"
/bin/sh: python: command not found
but if I clic on 'Run & Debug' in the left panel I get:
➜ test /usr/bin/env /usr/local/bin/python3.9 /Users/user/.vscode/extensions/ms-python.python-2022.4.1/pythonFiles/lib/python/debugpy/launcher 56623 -- /Users/user/Desktop/test/test.py
Hello World!
Weirdly, if I try to run the program with the run button from the touchbar it works:
➜ test cd /Users/hugo/Desktop/test ; /usr/bin/env /usr/local/bin/python3.9 /Users/hugo/.vscode/extensions/ms-python.python-2022.4.1/pythonFiles/lib/python/debugpy/launcher 56632 -- /Users/hug
o/Desktop/test/test.py
Hello World!
Could this problem be related to Apple removing Python2 from macOS in Monterey ?
I noticed that the command "python" wasn't working anymore in my terminal so think it might be related to that, but I'm not sure how to solve that in vscode without messing up paths
