atom-community / atom-community/ide-python

python executable not detected outside of pipenv project

オープン
#218 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
238
フォーク
40
PR マージ指標
30日以内にマージされた PR はありません

説明

My system python is installed via homebrew/miniconda:
```
$ which python
/usr/local/Caskroom/miniconda/base/bin/python
```
When the python executable setting is left as default `python` PyLS spins up from the base environment fine.

If I set up a project with pipenv and use the suggested `$PIPENV_PATH/bin/python` then it spins up PyLS in the virtual environment and works fine for that project. However, outside of the project the python executable cannot be found.

From reviewing the code it looks like outside of a pipenv project the python path becomes `/bin/python` which is not where my system python lives. It needs to fallback to just `python`.

----
I can see that `$PIPENV_PATH` gets replaced with the output of `pipenv --venv`, however you could use `pipenv --py` to get the full path to the interpreter (or just append `/bin/python` as it's always that). In that case the executable setting won't be needed for pipenv, so it can just remain as the default `python` or be set as an absolute path if needed.

----
N.B As a workaround I tried to symlink `/bin/python` to my miniconda python. However on MacOS SIP prevents this. I'd rather not have to disable it.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

この issue は実行可能ファイルの設定と Pipenv 統合に関するものです。まず、Pipenv プロジェクトが存在しない場合に `$PIPENV_PATH` がどのように展開されるかを追跡します。報告されている `pipenv --venv` の動作を `pipenv --py` と比較し、続いてデフォルトの `python` が Pipenv プロジェクトの内外の両方で動作することを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, python
領域
devtools
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。