question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error while checking Pylint path

See original GitHub issue

Step 1: Are you in the right place?

  • I have verified there are no duplicate active or recent bugs, questions, or requests
  • I have verified that I am using the latest version of the plugin.

Step 2: Describe your environment

  • Plugin version: v0.10.2
  • PyCharm/IDEA version: IDEA 2018.3.2
  • Pylint version: 1.5.5

Step 3: Describe the problem:

Steps to reproduce:

  1. Install pyenv, pyenv-virtualenv, and python 2.7.15
  2. Create a virtualenv with pyenv virtualenv 2.7.15 venvname
  3. pip install pylint==1.5.5
  4. Open IDEA, create a python project using the above venvname as the python sdk
  5. Close IDEA, reopen it
  6. Error is thrown

Observed Results:

  • An error in the event log. The plugin seems to keep working even though it throws that error.

Expected Results:

  • No error to be thrown.

Relevant Code:

No code to report

java.lang.Throwable: Error while checking Pylint path:   File "/Users/thiago.oliveira/.pyenv/shims/pylint", line 3
    [ -n "$PYENV_DEBUG" ] && set -x
                      ^
SyntaxError: invalid syntax
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:134)
	at com.leinardi.pycharm.pylint.plapi.PylintRunner.isPylintPathValid(PylintRunner.java:98)
	at com.leinardi.pycharm.pylint.ui.PylintConfigPanel$TestAction.actionPerformed(PylintConfigPanel.java:115)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
	at java.awt.Component.processMouseEvent(Component.java:6548)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3325)
	at java.awt.Component.processEvent(Component.java:6313)
	at java.awt.Container.processEvent(Container.java:2237)
	at java.awt.Component.dispatchEventImpl(Component.java:4903)
	at java.awt.Container.dispatchEventImpl(Container.java:2295)
	at java.awt.Component.dispatchEvent(Component.java:4725)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
	at java.awt.Container.dispatchEventImpl(Container.java:2281)
	at java.awt.Window.dispatchEventImpl(Window.java:2746)
	at java.awt.Component.dispatchEvent(Component.java:4725)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
	at java.awt.EventQueue.access$500(EventQueue.java:98)
	at java.awt.EventQueue$3.run(EventQueue.java:715)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
	at java.awt.EventQueue$4.run(EventQueue.java:737)
	at java.awt.EventQueue$4.run(EventQueue.java:735)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:719)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:664)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:363)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)
	at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
	at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
	at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
	at java.awt.Dialog.show(Dialog.java:1077)
	at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:698)
	at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:430)
	at com.intellij.openapi.ui.DialogWrapper.invokeShow(DialogWrapper.java:1681)
	at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1630)
	at com.intellij.openapi.options.newEditor.SettingsDialog.lambda$show$0(SettingsDialog.java:70)
	at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88)
	at com.intellij.openapi.application.TransactionGuardImpl.submitTransactionAndWait(TransactionGuardImpl.java:153)
	at com.intellij.openapi.options.newEditor.SettingsDialog.show(SettingsDialog.java:70)
	at com.intellij.ide.actions.ShowSettingsUtilImpl.showSettingsDialog(ShowSettingsUtilImpl.java:84)
	at com.intellij.ide.actions.ShowSettingsAction.perform(ShowSettingsAction.java:50)
	at com.intellij.ide.MacOSApplicationProvider$Worker.lambda$null$1(MacOSApplicationProvider.java:104)
	at com.intellij.ide.MacOSApplicationProvider$Worker.lambda$submit$7(MacOSApplicationProvider.java:179)
	at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88)
	at com.intellij.openapi.application.TransactionGuardImpl.lambda$pollQueueLater$0(TransactionGuardImpl.java:74)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:435)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:419)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:403)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
	at java.awt.EventQueue.access$500(EventQueue.java:98)
	at java.awt.EventQueue$3.run(EventQueue.java:715)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:719)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:668)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:363)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

3reactions
boricecommented, Jan 22, 2019

I have the same issue on OSX Mojave with IDEA 2018.3. Details below:

> pylint --version
pylint 2.2.2
astroid 2.1.0
Python 3.6.8 |Anaconda, Inc.| (default, Dec 29 2018, 19:04:46)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)]
java.lang.Throwable: Pylint path detect process.exitValue: 1
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:134)
	at com.leinardi.pycharm.pylint.plapi.PylintRunner.detectSystemPylintPath(PylintRunner.java:218)
	at com.leinardi.pycharm.pylint.plapi.PylintRunner.getPylintPath(PylintRunner.java:144)
	at com.leinardi.pycharm.pylint.plapi.PylintRunner.getPylintPath(PylintRunner.java:120)
	at com.leinardi.pycharm.pylint.plapi.PylintRunner.checkPylintAvailable(PylintRunner.java:176)
	at com.leinardi.pycharm.pylint.plapi.PylintRunner.checkPylintAvailable(PylintRunner.java:150)
	at com.leinardi.pycharm.pylint.PylintInspection.inspectFile(PylintInspection.java:76)
	at com.leinardi.pycharm.pylint.PylintInspection.lambda$checkFile$0(PylintInspection.java:65)
	at com.intellij.openapi.application.impl.ApplicationImpl$2.call(ApplicationImpl.java:337)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

This happens when I’m working on a non-Python project (like Java, Scala, whatever) and I don’t manually configure the pylint path in the “Other Settings -> Pylint” section. If I work on a Python project and set the path to Pylint then the error doesn’t show up.

Even if I try setting the Pylint path when working on a non-Python project, when I click the “Test” button, a red X is displayed indicating that the test didn’t succeed. When looking at the idea.log file, the following error is recorded:

INFO - harm.pylint.plapi.PylintRunner - Command Line string: /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home /Applications/Development/anaconda3/bin/pylint --help-msg E1101 ile checking Pylint path
com.intellij.execution.process.ProcessNotCreatedException: Cannot run program "/Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home": error=13, Permission deniedon.configurations.GeneralCommandLine.createProcess(GeneralCommandLine.java:416)
        at com.leinardi.pycharm.pylint.plapi.PylintRunner.isPylintPathValid(PylintRunner.java:92)
        at com.leinardi.pycharm.pylint.ui.PylintConfigPanel$TestAction.actionPerformed(PylintConfigPanel.java:115)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
        ....

It seems the plugin is trying to run pylint using the current project’s SDK which, for a Java project (for example) would be the JDK. Obviously that won’t work. I think this happens here: https://github.com/leinardi/pylint-pycharm/blob/4af2fe58d7edc3c3d187d538b6bd4308493f32f7/src/main/java/com/leinardi/pycharm/pylint/plapi/PylintRunner.java#L318

Perhaps this plugin should skip the detection of pylint for non-Python projects (if possible).

Thanks for the plugin!

0reactions
chilicheechcommented, Nov 4, 2020

I’m no longer seeing the original issue that was reported. But I’m seeing the issue @borice mentioned.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error while executing Pylint command from terminal on ...
It looks like Pylint is unable to parse your command properly. if you want to ... if for a specific file use the...
Read more >
A curated list of pylint errors with explanation and examples
A list of pylint-errors with reasoning and examples of erroneous and correct ... directory where pipx stores apps is on PATH $ python3...
Read more >
Pylint Errors | Improve Your Code with Pylint and Black
If you are using pre-commit, the Pylint errors will be the same as if using Pylint alone. We highly recommend using pre-commit. For...
Read more >
Running Pylint - Pylint 2.16.0-dev documentation
Discovered problems by checkers are not displayed immediately. They are shown just after checking a module is complete.
Read more >
Linting Python in Visual Studio Code
Linting highlights syntactical and stylistic problems in your Python source code, which often helps you identify and correct subtle programming errors or ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found