January 16, 2006 
  • by John
  • in Python
  • Comments ( 6 )

Installing PyLint on Windows

Based on the Komodo/PyLint discussion of the last few days, I decided it was a good night to try to get everything installed and working on my Windows box.

Here’s what I had to do to get it all working…


1. Add Python directories to your path
Right click on My Computer on your desktop and go to the Advanced tab:

spacer

Click the Environment Variables button, and under System Variables select Path:

spacer

Hit the Edit button and add C:\Python24;C:\Python24\Scripts to the path list:

spacer

2. Download packages

Download the following packages from Logilab:

  • Logilab ASTNG: Base representation of python source code for projects such as pychecker, pyreverse, pylint.
  • Logilab Common Libraries: Contains several modules providing low level functionnalities shared among some python projects developped by logilab.
  • PyLint: Source code checker.

After downloading, unpack them into their respective directories. I just used 7-Zip to extract them to folders on my desktop.

3. Install packages

Assuming you set your path correctly (see Step 1), you should be able to run Python from the Windows command line.

To install each package, open a cmd.exe shell (i.e. Start, Run, cmd.exe) and cd into each directory that you created in Step 2. From there run the following command:

python setup.py install

You should see a bunch of lines flash by as the files are copied over to your Python directory. Repeat for ASTNG, Common, and PyLint.

After you are done, if pylint.bat wasn’t copied to C:\Python24\Scripts, copy it over there manually.

4. Create pylint.bat redirect file

Create a file called pylint (no extension) in C:\Python24 that contains the following text:

C:\Python24\Scripts\pylint.bat

5. Add to Komodo toolbox (optional)

That should be it! You are ready to use PyLint to check your scripts. If you use Komodo as your IDE, you can now follow Mateusz’s instructions for running PyLint from Komodo.

Note: My instructions assume you are using Windows 2K/XP and Python 2.4. Obviously some things will change if you are using a different configuration.

More from this category

  • Pownce: Tiny URLs based on pk July 17, 2008 Google App Engine on ShowMeDo June 12, 2008 Django book ordered May 29, 2008 The 12 commandments for Python code May 3, 2008 Interesting Django sites April 24, 2008
« New Python.org beta site up
Basecamp API coming soon »

6 Responses to “Installing PyLint on Windows”

  1. spacer
    Brandon April 22, 2008 at 2:36 pm #

    If you are using eclipse and pydev then it just needs to know where lint.py is so you do not need to do steps 4 and 5. If you go to Window -> Preferences and drill down to Pydev -> Pylint check the “Use Pylint” box and then click on “Broswse” and go to %PYTHON_ROOT%\Lib\site-packages\pylint and select lint.py and you should be good to go. You will get some good highlighting of problems where pylint sees them.

  2. spacer
    Leszek Bajorski February 11, 2009 at 5:04 am #

    Hi,

    I’m using eclipse (pydev+pylint) for python development. I would like to configure pylint to accept lines shorter then 100 chars and try to change
    pylintrc for it, unfortunately it does not work.

    What is the correct location of pylintrc in Windows?
    Is any configuration on eclipse necessary?

    Could you help me?

  3. spacer
    Yassen March 7, 2009 at 7:45 am #

    Thanks a lot for this tip; works fine also for python 2.5!

  4. spacer
    Yassen March 8, 2009 at 10:44 am #

    UPDATE: unfortunately, pylint installs fine but DOES NOT WORK on Windows, cpython 2.5. Looks like the logilab guys discriminate the hated platform as their code does not do any effort to recognize the platform and adapt accordingly :(

  5. spacer
    NicolasChauvat March 23, 2009 at 12:15 pm #

    If you found a bug in pylint, the right place to report it is lists.logilab.org/mailman/listinfo/python-projects

    Complaining in a comment of a blog will get you nowhere.

  6. spacer
    Adam April 29, 2009 at 11:09 pm #

    At 1st I had the same problem as Yassen (“pylint installs fine but DOES NOT WORK”):
    I had installed the 3 packages {ASTNG, common, pylint } individually using “python setup.py install” for each. Pylint was NOT functioning properly, a phenomenon I could test directly from the Python command-line interpreter:
    The line “from pylint import lint” issued an error.

    So I got rid of these packages and did “easy_install pylint” and everything was fine after that.
    (I installed the setuptools package and scripts (setuptools-0.6c9.win32-py2.5.exe) to get easy_install to work on my PC).

Leave a Reply

Click here to cancel reply.

gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.