Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pylint via mason nuances result in import errors when using poetry and pyenv #59

Open
Eptarch opened this issue Apr 11, 2024 · 0 comments

Comments

@Eptarch
Copy link

Eptarch commented Apr 11, 2024

Hey, thanks for the great tutorials and setup guide for neovim!

In your latest guide, you add pylint into mason.lua file and then you specify it in linting.lua for python files.

The thing is, Mason installs pylint into its own virtualenv with different site-packages, and I fail to find a way to reliably configure it for different projects.

I use poetry and pyenv for juggling versions and environments, and even if I activate virtualenv by runninng poetry shell it won't pick up site-packages, since they're in another virtualenv that differs from the one I use in a project.

Related bit of how to configure pylint in nvim-lint: here
Related bit about different envs when installed via Mason: here
Related SO question on how to set --init-hook for pylinlt for a single static virtualenv: here

This possibly could be circumvented by installing pylint globally, but I haven't tested it yet, and I'd still better have it installed by Mason and configured within linting.lua.
Another option is to remove pylint from ensure_installed in mason.lua and from linting.lua

If you have any additional info on this, that'd be rad to read.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant