オープンソースなど他人の書いたコードを読むのに Sourcetrail 便利ですよね! (フリーとは思えないクオリティだ) 久々にインストールして使ってみたらエラー起きてました
エラー内容
エラーが起きたバージョン: 2021.4.19 Release 2021.4.19 · CoatiSoftware/Sourcetrail · GitHub
pythonプロジェクトを解析しようとすると次のようなエラーが
command ""/Applications/Sourcetrail.app/Contents/Resources/data/python/SourcetrailPythonIndexer" index --source-file-path="hogehoge" --database-file-path="hogehoge"" returned code "255" with message "File not found or resource error occurred.".
エラーになっているコマンド("/Applications/Sourcetrail.app/Contents/Resources/data/python/SourcetrailPythonIndexer" index --source-file-path="hogehoge" --database-file-path="hogehoge")を直接実行すると
jedi.api.environment.InvalidPythonEnvironment: Unable to find an executable Python environment.
ググると同様の現象が報告されていました
- https://github.com/CoatiSoftware/Sourcetrail/issues/1129
- https://github.com/CoatiSoftware/SourcetrailPythonIndexer/issues/13
解決策
- Versionを下げる 2020.2.43 をダウンロード
- Edit projectから、Python Environmentを今使っているpythonバイナリに設定
- ターミナルで $which python3 などで表示されるものを入力すれば良い
根本的な解決策ではないですが、ひとまず動くようにはなりました