-1

I've just installed pychecker on windows 7 Pro using "python setup.py install". When I run it on my script using the command:

c:\Python26\Scripts\pychecker -#100 finaltest17.py

I get the following error/traceback:

C:\Users\....\ToBeReleased>C:\Python26\python.exe C:\Python26\Lib\site-packages\pychecker\checker.py -#100 finaltest17.py
Processing module finaltest17 (finaltest17.py)...
  Caught exception importing module finaltest17:
    File "C:\Python26\Lib\site-packages\pychecker\pcmodules.py", line 533, in setupMainCode()
      self.moduleName, self.moduleDir)
    File "C:\Python26\Lib\site-packages\pychecker\pychecker\utils.py", line 184, in findModule()
      handle, filename, smt = _q_find_module(p, path)
    File "C:\Python26\Lib\site-packages\pychecker\pychecker\utils.py", line 162, in _q_find_module()
      if not cfg().quixote:
    File "C:\Python26\Lib\site-packages\pychecker\pychecker\utils.py", line 39, in cfg()
      return _cfg[-1]
  IndexError: list index out of range
Traceback (most recent call last):
  File "C:\Python26\Lib\site-packages\pychecker\checker.py", line 364, in <module>
    sys.exit(main(sys.argv))
  File "C:\Python26\Lib\site-packages\pychecker\checker.py", line 337, in main
    importWarnings = processFiles(files, _cfg, _print_processing)
  File "C:\Python26\Lib\site-packages\pychecker\checker.py", line 270, in processFiles
    loaded = pcmodule.load()
  File "C:\Python26\Lib\site-packages\pychecker\pcmodules.py", line 477, in load

    return utils.cfg().ignoreImportErrors
  File "C:\Python26\Lib\site-packages\pychecker\pychecker\utils.py", line 39, in cfg
    return _cfg[-1]
IndexError: list index out of range

If anyone could point me in the right direction that would be great.

Thanks

Stewart

Laur Ivan
  • 4,117
  • 3
  • 38
  • 62
  • The command you say you executed, is not the same as the one shown i the error traceback. Please post the correct output. – Burhan Khalid Jul 07 '16 at 08:13
  • The error traceback is correct for the command I ran. When I run "Python26\Scripts\pychecker -#100 finaltest17.py" the first thing pychecker does is to run the command as "C:\Python26\python.exe C:\Python26\Lib\site-packages\pychecker\checker.py -#100 finaltest17.py" – Stewart Paton Jul 07 '16 at 08:21
  • The command you say you ran is `c:\Python26\Scripts\pychecker -#100 finaltest17.py`, but in the output, the commend is `C:\Python26\python.exe C:\Python26\Lib\site-packages\pychecker\checker.py -#100 finaltest17.py` - not the same thing. – Burhan Khalid Jul 07 '16 at 08:23
  • In windows "Python26\Scripts\pychecker" is a bat file which calls the explicite form "Python26\Lib\site-packages\pychecker\checker.py" – Stewart Paton Jul 07 '16 at 08:26

1 Answers1

0

Problem resolved. I found the following support request on SourceForge which refers to a need to use short format (8.3) path and filenames in pychecker.bat and not long format as is allowed in newer versions of Windows. https://sourceforge.net/p/pychecker/support-requests/7/#96cb

  • The contents of pychecker.py should be: C:\Python26\python.exe C:\Python26\Lib\site-p~1\pychec~1\checker.py %* and not "C:\Python26\python.exe C:\Python26\Lib\site-packages\pychecker\checker.py %* – Stewart Paton Jul 07 '16 at 13:08