pylyzer icon indicating copy to clipboard operation
pylyzer copied to clipboard

Mason: How do I specify python environment to use in pylyzer?

Open Quakumei opened this issue 1 year ago • 3 comments

The issue

#54 might have mentioned that, however they have a different issue. My question is more general.

I have two python environments - virtual env and system environment, which seems to be enforced by default. Why enforced?

When entering nvim, having executed source ./venv/bin/activate, pylyzer can't find installed modules. Example below:

streamlit module is installed, however pylyzer can't see it

Specs

NVIM: v0.9.2 pylyzer: v0.0.45 python env:

:!pip --version
pip 23.0.1 from /home/quakuei/Desktop/iamjaf/spbstu/postgre-tasks-spbstu/car_service/car_service_fr
ontend/venv/lib/python3.8/site-packages/pip (python 3.8)
:!which python                                                                           
/home/quakuei/Desktop/iamjaf/spbstu/postgre-tasks-spbstu/car_service/car_service_frontend/venv/bin/
python

What I've searched

Couldn't find information on that matter in documentation, unfortunately.

This is what I looked through

Saw pyright stackoverflow discussion on similar topic, however solution seems to be related to pyright, and also they used an older version of nvim

Saw venv-selector.nvim on github, however no out-of-box support for pylyzer mentioned.

What can I do to specify the python environment to use for pylyzer? Thanks.

Quakumei avatar Sep 18 '23 11:09 Quakumei

#22

It's currently not supported.

TudorAndrei avatar Oct 04 '23 08:10 TudorAndrei

Ideally it should read VIRTUAL_ENV automatically.

failable avatar Oct 10 '23 07:10 failable

pyright read pyproject.toml https://microsoft.github.io/pyright/#/configuration?id=pyright-configuration

[tool.pyright]
venvPath = "."
venv = ".venv"

erasin avatar May 06 '24 07:05 erasin