How to install PyLint for Python 3

PyLint is a useful tool to improve code quality and to ensure that it complies with PEP-8 style guidelines. Sadly, Ubuntu only ships with the PyLint for Python 2.x. If you are using Python 3.x, then do the following:

  • If you have the Python 2.x version of PyLint, then remove it:
$ sudo apt remove pylint
  • Install the PIP installer for Python 3.x:
$ sudo apt install python3-pip
  • Install the PyLint for Python 3.x using PIP3:
$ sudo pip3 install pylint
  • If you need to use the GUI of PyLint, then install Tk for Python 3.x:
$ sudo apt install python3-tk
  • You can now use the PyLint for Python 3.x:
$ pylint ./foo.py
$ pylint-gui

Tried with: PyLint 1.4.0, PIP 1.5.4, Python 3.4.0 and Ubuntu 14.04

Advertisements

3 thoughts on “How to install PyLint for Python 3”

  1. $ apt-cache search pylint |grep ^pylint
    pylint – Python code static checker and UML diagram generator
    pylint3 – Python 3 code static checker and UML diagram generator
    $ cat /etc/issue
    Ubuntu 15.10 \n \l

    Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s