atom-community / atom-community/ide-python

python executable not detected outside of pipenv project

未关闭
#218 1 条评论 0 个 reaction 已指派 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 摘要。