0

So i'm trying to setup the python code checkers suggested in the emacs wiki. However, I'm unable to run those scripts in my command shell let alone emacs. The section is found here: http://www.emacswiki.org/emacs/PythonProgrammingInEmacs#toc7 And I tried the script located here and here

In both cases I changed the first line from #!usr/bin python with the full path of my python executable and when I run the scripts via

python pylint_etc_wrappers.py someModule.py 

or

python pycheckers.py soemModule.py

both boil down to the same error, most likely because they try to open a subprocess. Here's the trace:

Traceback (most recent call last):
  File "pycheckers.py", line 254, in <module>
    runner.run(source_file)
  File "pycheckers.py", line 91, in run
    process = Popen(args, stdout=PIPE, stderr=PIPE)
  File "C:\devel\Python\Python-2.7\Lib\subprocess.py", line 672, in __init__
    errread, errwrite)
  File "C:\devel\Python\Python-2.7\Lib\subprocess.py", line 882, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

The second script suggests to change the first line to the path of the interpreter (which I did) and to change the path in the main function which looks something like :

os.environ['PATH'] = \
      path.dirname(sys.executable) + ':' + os.environ['PATH']

which was a bit unclear to me. Any ideas?

octi
  • 1,470
  • 1
  • 17
  • 28
  • At a guess, you need to make sure that `pylint` etc. are on your path. – Thomas K Dec 08 '11 at 17:37
  • they are in the \Scripts directory which I have added to the system path. I don't think this is the issue. Would be interesting if someone could duplicate these errors on a Win machine – octi Dec 08 '11 at 17:52

1 Answers1

1

I have pylint 0.25.1, installed using easy_install (Python 2.7, Win XP). Both pylint and pylint.bat were installed in Python27/Scripts (this directory is in my PATH).

I too get the "The system cannot find the file specified" error when running the pylint_etc_wrapper.py script unchanged.

Running pylint from the script does work if

command = 'pylint'

is changed to

command = 'pylint.bat'

Another way to make it work is to add shell=True to the Popen() call.

I can't really explain all this, but there is an unresolved Python bug that looks like it might be relevant: http://bugs.python.org/issue8557.

mzjn
  • 48,958
  • 13
  • 128
  • 248
  • that did it! i had to do the same for pyflakes and changed the command to pyflakes.bat – octi Dec 12 '11 at 14:54