Skip to main content

pylint-venv provides a Pylint init-hook to use the same Pylint installation with different virtual environments.

Project description

Pylint does not respect the currently activated virtualenv if it is not installed in every virtual environment individually. This module provides a Pylint init-hook to use the same Pylint installation with different virtual environments.


pip install pylint-venv

Add the following to your ~/.pylintrc:

    try: import pylint_venv
    except ImportError: pass
    else: pylint_venv.inithook()

The hook will then be used automatically if

  • a virtualenv is activated
  • a Conda environment is activated
  • no env is activated but your CWD contains a virtualenv in .venv

and if pylint is not installed in that env, too.

You can also call the hook via a command line argument:

$ pylint --init-hook="import pylint_venv; pylint_venv.inithook()"

This way you can also explicitly set an environment to be used:

$ pylint --init-hook="import pylint_venv; pylint_venv.inithook('$(pwd)/env')"

If pylint itself is installed in a virtualenv, then you can ignore it by passing force_venv_activation=True to force the activation of a different virtualenv:

$ pylint --init-hook="import pylint_venv; pylint_venv.inithook(force_venv_activation=True)"

This will try to automatically detect virtualenv and activate it.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pylint-venv, version 2.1.1
Filename, size File type Python version Upload date Hashes
Filename, size pylint_venv-2.1.1-py3-none-any.whl (4.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pylint-venv-2.1.1.tar.gz (4.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page