When I try to open VSCode from the command line with code ., I get the error ./MacOS/Electron: No such file or directory. How can I fix this?
If you're getting following Error:
/usr/local/bin/code: line 6: /usr/bin/python: No such file or directory
/usr/local/bin/code: line 10: ./MacOS/Electron: No such file or directory
Update python to python3 in following File:
/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin/code
To avoid changing VS Code files, you can add file named python to your path that just execs python3. For example, create a new file named /usr/local/bin/python:
#!/bin/sh
# work around missing `python` executable by calling `python3`
exec python3 "$@"
Then chmod a+x /usr/local/bin/python
After quitting and relaunching your shell to ensure paths are re-hashed, everything should work again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With