atom-community / atom-community/ide-python

python executable not detected outside of pipenv project

Đang mở
#218 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
238
Fork
40
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Issue này liên quan đến cài đặt executable và tích hợp Pipenv; hãy bắt đầu bằng cách truy vết cách `$PIPENV_PATH` được mở rộng khi không có dự án Pipenv nào. So sánh hành vi được báo cáo của `pipenv --venv` với `pipenv --py`, sau đó xác minh rằng `python` mặc định hoạt động cả bên trong lẫn bên ngoài một dự án Pipenv.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript, python
Lĩnh vực
devtools
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.