0

I recently change my laptop, windows to mac.

I downloaded python and vscode and install python extension as i did on windows.

Then i edited task json file to use cmd +shift +b for building shortcut.

However when i build the file, there's an error saying on terminal "zsh:command not found:python".

What should i do?

I researched and knew maybe i have to change default app, python to python3, but don't know how.

Actually i'm not certain this is the problem.

김호균
  • 11
  • 1
  • 1
    Does this answer your question? [How can I fix the "zsh: command not found: python" error? (macOS Monterey 12.3, Python 3.10, Atom IDE, and atom-python-run 0.9.7)](https://stackoverflow.com/questions/71591971/how-can-i-fix-the-zsh-command-not-found-python-error-macos-monterey-12-3) – JialeDu Nov 16 '22 at 09:33
  • You need to put the directory where your Python is located, into your path, i.e. `path+=(/path/to/python/directory`). For the safe side, do a `rehash` afterwards. – user1934428 Nov 16 '22 at 12:54

1 Answers1

0

You need to add python to zsh by running the following in the terminal:

echo "alias python=/usr/bin/python3" >> ~/.zshrc
MingJie-MSFT
  • 5,569
  • 1
  • 2
  • 13