0

I'm a Mac user and new to coding. I want to open VS Code from iterm2. I followed the instruction from an article, but I couldn't open it.

  1. I opened VS Code command palette then typed shell.
  2. I clicked Shell Command: install 'code' command in PATH. VS code showed Shell command 'code' successfully installed in PATH.
  3. I opened my terminal and typed code . and my terminal showed:
code .
/usr/local/bin/code: line 6: python: command not found 
/usr/local/bin/code: line 10: ./MacOS/Electron: No such file or directory

How can I fix this?

ccchoy
  • 704
  • 7
  • 16
calipalm
  • 3
  • 4
  • https://github.com/microsoft/vscode/issues/141738 - likely an issue with your environment setup. Ensure that you have a working installation of python. For example, in your terminal can you successfully run `python`? If not, probably need to install it. Otherwise sounds like discoverability issues - would try uninstalling and reinstalling python and then vs code and then the code command. Also try in a native MacOS terminal (rather than iterm2) - if it works there then something related to iterm2's shell profile. – ccchoy Oct 21 '22 at 18:46
  • Also seems like a duplicate of this https://stackoverflow.com/questions/60842487/python-was-not-found-but-can-be-installed-from-the-microsoft-store-march-2020 - although there's unfrotunately no accepted answer there either. – ccchoy Oct 21 '22 at 18:47
  • I installed python about 2 yeasrs ago and used it for a bit then never used it for a while. what I'm trying to do is just following git lessons from youtube :( it's nothing to do with Python. Should I delete the python? – calipalm Oct 21 '22 at 21:46
  • If you're not able to execute `python` from a terminal, then I'd probably recommend fixing your python installation first - an easy way could just be reinstalling. Otherwise, opening VS Code using the binary is probably not required for whatever git lessons on YT you're trying to do - just open the application as you would any other on MacOS rather than trying to use `code` from a terminal. It's the same - just preference and the actual app probably doesn't rely on python. – ccchoy Oct 21 '22 at 23:02

0 Answers0