简体   繁体   中英

M1 vscode python error (zsh: command not found : python)

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.

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

echo "alias python=/usr/bin/python3" >> ~/.zshrc

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM