LoginSignup
9
5

More than 5 years have passed since last update.

Visual Studio Codeを codeコマンドで立ち上げようとしたら、エラーになったのでその対処

Posted at

Visual Studio Codeを $ code で立ち上げようとすると、エラーになったのでその対処です。

エラー内容

$ code .
/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

原因と対処

どうやら、 /usr/bin/python のPythonを呼び出してるけど、それが僕の環境にはない。
僕は、pyenv でPythonのバージョン管理をしているので、そのせいかなと思います。

そこで、シンボリックリンクを貼ったら解決できました。

  • Pythonの場所確認
$ which python
/Users/hoge/.pyenv/shims/python
  • シンボリックリンク作成
$ sudo ln -s /Users/hoge/.pyenv/shims/python /usr/bin/python

これでOK!

$ code .
9
5
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
5