Skip to content

Document how to configure the location of site packages in pylint  #9974

Open
@paulrougieux

Description

@paulrougieux

Current problem

The configuration section of the pylint help doesn't explain how to configure the path to the python interpreter and/ or the path to the packages that should be recognised as present by pylint.
https://pylint.pycqa.org/en/latest/user_guide/configuration/index.html

Desired solution

The accepted answer here explains how to define the path to site packages in the pylint configuration
https://stackoverflow.com/a/3065082/2641825

Edit a user's configuration file

vim ~/.pylintrc

The content of the configuration file is as follows:

[pylint]
# Use a virtual environment used for development
init-hook='import sys; sys.path.append("/home/user/python_env/lib/python3.11/site-packages/")'

Adding the path to site packages in the virtual environment is necessary in
order to avoid pylint using the base system version of python, which doesn't
have all packages installed. This avoids reporting package not installed errors.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Documentation 📗Needs PRThis issue is accepted, sufficiently specified and now needs an implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions