LoginSignup
0
0

More than 1 year has passed since last update.

【解決】Pycharmのvenvでbad interpreter: No such file or directory と表示される。

Posted at

結論

xcode-select --install

概要

PyCharmのvenv環境でjupyter notebookを起動しようとしたところbad interpreter: No such file or directoryと表示されjupyter notebookが起動されない。
原因を探るため、PyCharmでinterpreterとして設定していたPythonのpathを指定して-Vしてみると

$ /usr/bin/python3 -V
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

と出てバージョンが表示されない。
なぜだ…と思いエラーメッセージでググると、この現象はMacOSのメジャーアップデート後によく起きがちなことらしく、xcode-select --installを実行すれば解決するそうな。

確かに最近Montereyにアップデートしたばかりだ…
ということで実際にやってみた。

$ xcode-select --install
xcode-select: note: install requested for command line developer tools
$ /usr/bin/python3 -V
Python 3.8.9

PyCharmでinterpreterとして設定していたPythonはバージョン表示されるようになった。
PyCharmでもvenvがつくられるようになった。
めでたしめでたし。

0
0
0

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
0
0