sublimelsp / LSP-pyright

Python support for Sublime's LSP plugin provided through microsoft/pyright.
MIT License
126 stars 13 forks source link

Pipenv using wrong Python path #332

Closed gardenerik closed 3 months ago

gardenerik commented 3 months ago

Hello, when using LSP-pyright with Pipenv (2023.12.1) with a project that contains a .env file, it fails to correctly detect the Python executable, due to a unrelated log message from Pipenv:

LSP-pyright: INFO: Pipfile detected. Run subprocess command: pipenv --py
LSP-pyright: INFO: Using python path "Loading .env environment variables...
/home/gardener/.local/share/virtualenvs/bill-gl5kfYRG/bin/python"

Note the Loading .env environment variables... in the Python path. It seems like that is printed to stderr.

jfcherng commented 3 months ago

I can reproduce this when there are both .env and Pipfile exists at the same time.

jfcherng commented 3 months ago

Should have been fixed in v1.3.7

gardenerik commented 3 months ago

Wow... That was quick. Thank you very much!