Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Linter cannot find pylint #80

Closed
TheGuardianWolf opened this issue Oct 8, 2015 · 18 comments
Closed

Linter cannot find pylint #80

TheGuardianWolf opened this issue Oct 8, 2015 · 18 comments
Labels

Comments

@TheGuardianWolf
Copy link

Am running windows, Pylint was added via pip.

However this error is occurring:

Failed to spawn command pylint. Make sure pylint is installed and on your PATH

Error: spawn C:\WINDOWS\system32\cmd.exe ENOENT
Error: spawn C:\WINDOWS\system32\cmd.exe ENOENT
  at exports._errnoException (util.js:814:11)
  at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
  at onErrorNT (internal/child_process.js:344:16)
  at doNTCallback2 (node.js:438:9)
  at process._tickCallback (node.js:352:17)

I have checked and pylint does run in cmd so it does happen to be on the PATH. I've tried manually setting it but that still does not work.

@SpainTrain
Copy link
Member

Can you share you config.cson? This shouldn't be an issue in windows, but could you try running atom from CLI and see if the issue persists?

@TheGuardianWolf
Copy link
Author

Tried running from CLI, seems to be working now.

Went back and tested atom from just normal launch, that's working too.

I did reinstall pylint but not sure if that would affect anything as previously I've tried doing that with no success.

But anyway, issue is solved now.

Config just for the sake of it:

"*":
  "exception-reporting":
    userId: "75bbd08c-048b-2f1a-5a6c-6f5d60d63e97"
  welcome:
    showOnStartup: false
  core:
    disabledPackages: [
      "linter-python-pyflakes"
    ]
  editor:
    invisibles: {}
    fontSize: 17
  "save-session":
    dataSaveFolder: "C:\\Users\\lichk\\.atom\\packages\\save-session\\projects"
  "autocomplete-plus": {}
  "atom-compile-less": {}
  "atom-minify":
    checkOutputFileAlreadyExists: true
    jsMinifier: "UglifyJS2"
    minifyOnSave: true
  autoprefixer: {}
  emmet: {}
  linter:
    showErrorPanel: false
  "linter-pylint":
    pythonPath: "%p"
  "linter-less": {}
  "linter-php":
    executablePath: "C:\\Programming\\PHP\\php.exe"
  "linter-python-pep8":
    pep8DirToExecutable: "C:\\tools\\python\\Scripts\\"
  "linter-python-pyflakes":
    pyflakesDirToExecutable: "C:\\tools\\python\\Scripts\\"
  "linter-htmlhint":
    executablePath: "C:\\Users\\lichk\\AppData\\Roaming\\npm\\node_modules\\htmlhint\\bin\\htmlhint"
  "linter-pyflakes":
    pyflakesExecutablePath: "pyflakes"

@tildebyte
Copy link

@SpainTrain : I have exactly same issue, only it's not auto-resolving for me. I have:

  • Win 7 Pro, atom 1.2.4, all plugins up-to-date
  • Win 10 Pro, atom 1.2.4, all plugins up-to-date

Both machines:

  • Have up-to-date Anaconda Python 2.7, with flake8, pylint, and autopep8 conda installed
  • Can run all three commands from command prompt without issue

Here's my config.cson, but consider this: flake8 and autopep8 work without configuration (autopep8 isn't a linter plugin, but it's similar enough to flake8 and pylint to provide another data point).
linter-pylint has worked on both machines before (as recently as yesterday).
Running atom from shortcut/directly from batch/from command line/as admin/not as admin - none of that makes any difference.

--version:
flake8: 2.3.0 (pep8: 1.6.2, pyflakes: 1.0.0, mccabe: 0.3)
pylint: pylint-script.py 1.4.2, astroid 1.3.4, common 0.63.2
autopep8: autopep8 1.2.1

atom errors:
Pop-up

Error: spawn C:\WINDOWS\system32\cmd.exe ENOENT
    at exports._errnoException (util.js:837:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
    at onErrorNT (internal/child_process.js:344:16)
    at doNTCallback2 (node.js:441:9)
    at process._tickCallback (node.js:355:17)

Console
Uncaught BufferedProcessError: Failed to spawn command pylint. Make sure pylint is installed and on your PATH C:\Users\______\AppData\Local\atom\app-1.2.4\resources\app.asar\src\buffered-process.js:260

@Arcanemagus
Copy link
Member

Silly question, but does C:\WINDOWS\system32\cmd.exe exist?

@tildebyte
Copy link

Not that silly, but yes.

@TheGuardianWolf
Copy link
Author

I had to do a clonezilla restore today on the computer that was affected by this issue previously, so I thought I'd provide some additional info. It is working perfectly here on the first try unlike last time.

Atom was preinstalled with the image.
I installed linter package, then the pylint package for linter.
I added python's script folder to path, then ran 'pip install pylint'.

After these steps, it immediately started working without errors.

@tildebyte
Copy link

Another weird data point which I forgot last night: tracing file i/o with Sysinternals procmon shows (or perhaps, doesn't show) that atom isn't even looking for the pylint executable, and that it is finding the Python scripts directory with no problem.

@Arcanemagus
Copy link
Member

@tildebyte Does it work if you hard code the path in the config?

@SpainTrain
Copy link
Member

@tildebyte odd. Could you open dev tools in atom (same hotkey as chrome), set a breakpoint inside linter-pylint, and see whether the plugin is being run?

@tildebyte
Copy link

@Arcanemagus I've tried putting all sorts of things in the config, including the path to pep8 just for kicks.

@SpainTrain I'll try to do that sometime this evening.

@Arcanemagus
Copy link
Member

Just to be specific: On my system at least the executablePath setting would be C:\Python27\Scripts\pylint.exe if I were to hard code it.

@tildebyte
Copy link

Really should be C:/Python27/Scripts/pylint.exe (note the slashes).
FYI, linter-pylama is working fine here, and I think I'm going to stick with it, as it works well, and includes, like, everything (McCabe, PEP257, PEP8, PyFlakes, Pylint).

@Arcanemagus
Copy link
Member

The slashes were correct, although either should work. It would be nice if you could continue helping us with debugging this as I at least can't reproduce this myself.

@Yarn
Copy link

Yarn commented Dec 13, 2015

I'm having this issue. Placing a breakpoint at line 73 or 76 in main.coffee seems to indicate the add-on is being run.
Also at line 83 of helper.js after an exception was thrown I looked at the value of _ref in case it helps
capture

@wangjoshuah
Copy link

any update on this for mac? I've got pylint working from terminal, but get "Failed to spawn command pylint. Make sure pylint is installed and on your PATH" and

Error: spawn pylint ENOENT
    at exports._errnoException (util.js:837:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
    at onErrorNT (internal/child_process.js:344:16)
    at doNTCallback2 (node.js:441:9)
    at process._tickCallback (node.js:355:17)

error as well.

@Saberre
Copy link

Saberre commented Mar 3, 2016

I had a same issue and found that when a file is opened as directory (like below screenshot) 'cwd' value has a path to file, not a directory.

image

If you can debug pylint script, set a breakpoint in line 76 of main.coffee and check what cwd variable has.

@fx86
Copy link

fx86 commented Mar 24, 2016

pylint throws the same error on OSX as above.

@wangjoshuah Did you get something to work ?

leohemsted added a commit to leohemsted/linter-pylint that referenced this issue Apr 4, 2016
leohemsted added a commit to leohemsted/linter-pylint that referenced this issue Apr 4, 2016
leohemsted added a commit to leohemsted/linter-pylint that referenced this issue Apr 4, 2016
leohemsted added a commit to leohemsted/linter-pylint that referenced this issue Apr 4, 2016
@Arcanemagus
Copy link
Member

Marking this as closed, if you are still experiencing this please file a new issue with details such as:

  • Operating system
  • Atom version
  • Whether pylint is working from the CLI for you
  • How you are launching Atom

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

8 participants