【发布时间】:2016-07-07 08:03:09
【问题描述】:
我刚刚使用“python setup.py install”在 Windows 7 Pro 上安装了 pychecker。当我使用命令在我的脚本上运行它时:
c:\Python26\Scripts\pychecker -#100 finaltest17.py
我收到以下错误/回溯:
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
如果有人能指出我正确的方向,那就太好了。
谢谢
斯图尔特
【问题讨论】:
-
您说您执行的命令与错误回溯中显示的命令不同。请发布正确的输出。
-
错误回溯对于我运行的命令是正确的。当我运行“Python26\Scripts\pychecker -#100 finaltest17.py”时,pychecker 所做的第一件事就是将命令运行为“C:\Python26\python.exe C:\Python26\Lib\site-packages\pychecker\checker .py -#100 finaltest17.py"
-
你说你运行的命令是
c:\Python26\Scripts\pychecker -#100 finaltest17.py,但在输出中,推荐是C:\Python26\python.exe C:\Python26\Lib\site-packages\pychecker\checker.py -#100 finaltest17.py——不是一回事。 -
在 windows 中“Python26\Scripts\pychecker”是一个 bat 文件,它调用显式形式“Python26\Lib\site-packages\pychecker\checker.py”
标签: python python-2.6 pychecker