Get Pylint to work with Python 3 programs

Here’s my note on getting Pylint to work with Python3. The issue is that I also have Python2.7 installed on the machine. As a result, when I just run “pylint”, the script gives “invalid syntax” errors.

One trick I did was to use the following command instead

python3 -m pylint

This seems to triggers the pylint for Python3 as it executes the pylint with python3. The “-m” option runs library modules as a script.

I got the hint from this post here (

I also just realized that pylint is also doing static code analysis and can detect many errors statically like a compiler, which is very cool!

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s