leinardi / pylint-pycharm

A plugin providing both real-time and on-demand scanning of Python files with PyLint from within PyCharm/IDEA.
Apache License 2.0
197 stars 35 forks source link

Exception in Plugin pylint #29

Closed rohith94 closed 5 years ago

rohith94 commented 5 years ago

Step 1: Are you in the right place?

Step 2: Describe your environment

Step 3: Describe the problem:

stack trace

java.lang.Throwable: Pylint path detect process.exitValue: 1 at com.intellij.openapi.diagnostic.Logger.error(Logger.java:123) 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)

included text

Following exceptions happened soon after this one, most probably they are induced.

2018-09-26T17:04:33.821 java.lang.Throwable: Pylint path detect process.exitValue: 1 at com.intellij.openapi.diagnostic.Logger.error(Logger.java:123) 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)

2018-09-26T17:04:34.424 java.lang.Throwable: Pylint path detect process.exitValue: 1 at com.intellij.openapi.diagnostic.Logger.error(Logger.java:123) 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)

2018-09-26T17:04:34.894 java.lang.Throwable: Pylint path detect process.exitValue: 1 at com.intellij.openapi.diagnostic.Logger.error(Logger.java:123) 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)

2018-09-26T17:04:35.218 java.lang.Throwable: Error while checking Pylint path: /home/rm/mytemp/LoggerInPython/venv/bin/python: can't find 'main' module in '/home/rm/mytemp/LoggerInPython/' at com.intellij.openapi.diagnostic.Logger.error(Logger.java:123) at com.leinardi.pycharm.pylint.plapi.PylintRunner.isPylintPathValid(PylintRunner.java:98) 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)

2018-09-26T17:04:35.276 java.lang.Throwable: Pylint path detect process.exitValue: 1 at com.intellij.openapi.diagnostic.Logger.error(Logger.java:123) 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)

Steps to reproduce:

  1. every time pycharm is restarted
leinardi commented 5 years ago

Hi @rohith94, Could you please attach the idea.log file (https://intellij-support.jetbrains.com/hc/en-us/articles/207241085-Locating-IDE-log-files) after you get the Exception?

rohith94 commented 5 years ago

Hi , PFA idea.log

EricRFMA-ES commented 5 years ago

I'm having the exact same issue, slightly different configuration:

Hope that helps...

switchtrue commented 5 years ago

Not sure if this is also related:

java.lang.Throwable: Error while checking Pylint path: dyld: Library not loaded: @executable_path/../.Python
  Referenced from: /Users/mike/work/reposit/git/events-producer/venv/bin/python
  Reason: image not found
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:123)
    at com.leinardi.pycharm.pylint.plapi.PylintRunner.isPylintPathValid(PylintRunner.java:98)
    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)
rohith94 commented 5 years ago

Hi , PFA idea.log

adding few more details

PyCharm 2018.2.4 Build #PC-182.4505.26 JDK: 1.8.0_152-release VM: OpenJDK 64-Bit Server VM Vendor: JetBrains s.r.o OS: Linux

leinardi commented 5 years ago

Hi everyone, I cannot reproduce it locally but checking the logs it seems that the pylintPath is empty at some point:

2018-09-27 11:50:16,139 [  34178]   INFO - harm.pylint.plapi.PylintRunner - Command Line string: /home/rm/.virtualenvs/one-post/bin/python /home/rm/perfios/code/one-post/ --help-msg E1101

I added a new check for that, could you try this new dev build and tell me if fix the issue? pylint-plugin-0.10.2.zip

@switchtrue that looks to me like a different problem, probably is better to open a different issue.

EricRFMA-ES commented 5 years ago

I installed the 0.10.2 plugin, restarted PyCharm, and immediately got this:

java.lang.Throwable: Error while checking Pylint path: No config file found, using default configuration
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:123)
    at com.leinardi.pycharm.pylint.plapi.PylintRunner.isPylintPathValid(PylintRunner.java:98)
    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)
EricRFMA-ES commented 5 years ago

I tried uninstalling the 0.10.2 you posted above, restarting PyCharm, and installing the plugin again. This time, it didn't seem to get installed, and I got the following in my system.log:

Oct  1 15:55:49 zarquon pycharm[64276]: *** Assertion failure in -[AWTWindow_Normal _changeJustMain], /Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1404.47/AppKit.subproj/NSWindow.m:15931
Oct  1 15:55:49 zarquon pycharm[64276]: Invalid parameter not satisfying: [self canBecomeMainWindow]
Oct  1 15:55:49 zarquon pycharm[64276]: (
        0   CoreFoundation                      0x00007fff9657f452 __exceptionPreprocess + 178
        1   libobjc.A.dylib                     0x00007fff903bf73c objc_exception_throw + 48
        2   CoreFoundation                      0x00007fff9658416a +[NSException raise:format:arguments:] + 106
        3   Foundation                          0x00007fff892b5866 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
        4   AppKit                              0x00007fff996e6ad9 -[NSWindow _changeJustMain] + 307
        5   Foundation                          0x00007fff8923adbe __NSThreadPerformPerform + 279
        6   CoreFoundation                      0x00007fff965147e1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
        7   CoreFoundation                      0x00007fff964f3f0c __CFRunLoopDoSources0 + 556
        8   CoreFoundation                      0x00007fff964f342f __CFRunLoopRun + 927
        9   CoreFoundation                      0x00007fff964f2e28 CFRunLoopRunSpecific + 296
        10  HIToolbox                           0x00007fff8dcc8935 RunCurrentEventLoopInMode + 235
        11  HIToolbox                           0x00007fff8dcc8677 ReceiveNextEventCommon + 184
        12  HIToolbox                           0x00007fff8dcc85af _BlockUntilNextEventMatchingListInModeWithFilter + 71
        13  AppKit                              0x00007fff9940ddf6 _DPSNextEvent + 1067
        14  AppKit                              0x00007fff9940d226 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454
        15  libosxapp.dylib                     0x000000013846735e -[NSApplicationAWT nextEventMatchingMask:untilDate:inMode:dequeue:] + 124
        16  AppKit                              0x00007fff9967ca82 -[NSApplication _doModalLoop:peek:] + 653
        17  AppKit                              0x00007fff9985d6fb __35-[NSApplication runModalForWindow:]_block_invoke + 126
        18  AppKit                              0x00007fff9967a375 -[NSApplication runModalForWindow:] + 156
        19  libawt_lwawt.dylib                  0x00000001396c95e5 -[CFileDialog safeSaveOrLoad] + 813
        20  Foundation                          0x00007fff8923adbe __NSThreadPerformPerform + 279
        21  CoreFoundation                      0x00007fff965147e1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
        22  CoreFoundation                      0x00007fff964f3f0c __CFRunLoopDoSources0 + 556
        23  CoreFoundation                      0x00007fff964f342f __CFRunLoopRun + 927
        24  CoreFoundation                      0x00007fff964f2e28 CFRunLoopRunSpecific + 296
        25  HIToolbox                           0x00007fff8dcc8935 RunCurrentEventLoopInMode + 235
        26  HIToolbox                           0x00007fff8dcc876f ReceiveNextEventCommon + 432
        27  HIToolbox                           0x00007fff8dcc85af _BlockUntilNextEventMatchingListInModeWithFilter + 71
        28  AppKit                              0x00007fff9940ddf6 _DPSNextEvent + 1067
        29  AppKit                              0x00007fff9940d226 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454
        30  libosxapp.dylib                     0x000000013846735e -[NSApplicationAWT nextEventMatchingMask:untilDate:inMode:dequeue:] + 124
        31  AppKit                              0x00007fff99401d80 -[NSApplication run] + 682
        32  libosxapp.dylib                     0x0000000138467101 +[NSApplicationAWT runAWTLoopWithApp:] + 156
        33  libawt_lwawt.dylib                  0x00000001396f9417 -[AWTStarter starter:] + 905
        34  Foundation                          0x00007fff8923adbe __NSThreadPerformPerform + 279
        35  CoreFoundation                      0x00007fff965147e1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
        36  CoreFoundation                      0x00007fff964f3f0c __CFRunLoopDoSources0 + 556
        37  CoreFoundation                      0x00007fff964f342f __CFRunLoopRun + 927
        38  CoreFoundation                      0x00007fff964f2e28 CFRunLoopRunSpecific + 296
        39  pycharm                             0x000000010c0e8e0d main + 336
        40  libdyld.dylib                       0x00007fff985345ad start + 1
    )
Oct  1 15:55:49 zarquon pycharm[64276]: *** Assertion failure in -[AWTWindow_Normal _changeJustMain], /Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1404.47/AppKit.subproj/NSWindow.m:15931
Oct  1 15:55:49 zarquon pycharm[64276]: Invalid parameter not satisfying: [self canBecomeMainWindow]
Oct  1 15:55:49 zarquon pycharm[64276]: (
        0   CoreFoundation                      0x00007fff9657f452 __exceptionPreprocess + 178
        1   libobjc.A.dylib                     0x00007fff903bf73c objc_exception_throw + 48
        2   CoreFoundation                      0x00007fff9658416a +[NSException raise:format:arguments:] + 106
        3   Foundation                          0x00007fff892b5866 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
        4   AppKit                              0x00007fff996e6ad9 -[NSWindow _changeJustMain] + 307
        5   Foundation                          0x00007fff8923adbe __NSThreadPerformPerform + 279
        6   CoreFoundation                      0x00007fff965147e1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
        7   CoreFoundation                      0x00007fff964f3f0c __CFRunLoopDoSources0 + 556
        8   CoreFoundation                      0x00007fff964f342f __CFRunLoopRun + 927
        9   CoreFoundation                      0x00007fff964f2e28 CFRunLoopRunSpecific + 296
        10  HIToolbox                           0x00007fff8dcc8935 RunCurrentEventLoopInMode + 235
        11  HIToolbox                           0x00007fff8dcc8677 ReceiveNextEventCommon + 184
        12  HIToolbox                           0x00007fff8dcc85af _BlockUntilNextEventMatchingListInModeWithFilter + 71
        13  AppKit                              0x00007fff9940ddf6 _DPSNextEvent + 1067
        14  AppKit                              0x00007fff9940d226 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454
        15  libosxapp.dylib                     0x000000013846735e -[NSApplicationAWT nextEventMatchingMask:untilDate:inMode:dequeue:] + 124
        16  AppKit                              0x00007fff99401d80 -[NSApplication run] + 682
        17  libosxapp.dylib                     0x0000000138467101 +[NSApplicationAWT runAWTLoopWithApp:] + 156
        18  libawt_lwawt.dylib                  0x00000001396f9417 -[AWTStarter starter:] + 905
        19  Foundation                          0x00007fff8923adbe __NSThreadPerformPerform + 279
        20  CoreFoundation                      0x00007fff965147e1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
        21  CoreFoundation                      0x00007fff964f3f0c __CFRunLoopDoSources0 + 556
        22  CoreFoundation                      0x00007fff964f342f __CFRunLoopRun + 927
        23  CoreFoundation                      0x00007fff964f2e28 CFRunLoopRunSpecific + 296
        24  pycharm                             0x000000010c0e8e0d main + 336
        25  libdyld.dylib                       0x00007fff985345ad start + 1
    )

Hope that helps.

e2m4n commented 5 years ago

As discussed on SE, here're the lines from my idea.log when restarting Pycharm after first installation, hope this helps:

2018-10-23 09:34:17,105 [  51289]   INFO - harm.pylint.plapi.PylintRunner - Detected Pylint path: /usr/bin/pylint
2018-10-23 09:34:17,314 [  51498]   INFO - harm.pylint.plapi.PylintRunner - Command Line string: /home/aaron/qa-portal-venv/bin/python /usr/bin/pylint --help-msg E1101
2018-10-23 09:34:17,314 [  51498]  ERROR - harm.pylint.plapi.PylintRunner - Error while checking Pylint path: Traceback (most recent call last):
  File "/usr/bin/pylint", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/home/aaron/qa-portal-venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3098, in <module>
    @_call_aside
  File "/home/aaron/qa-portal-venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3082, in _call_aside
    f(*args, **kwargs)
  File "/home/aaron/qa-portal-venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3111, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/home/aaron/qa-portal-venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 575, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/home/aaron/qa-portal-venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 588, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/home/aaron/qa-portal-venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 777, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pylint==1.8.3' distribution was not found and is required by the application
java.lang.Throwable: Error while checking Pylint path: Traceback (most recent call last):
  File "/usr/bin/pylint", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/home/aaron/qa-portal-venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3098, in <module>
    @_call_aside
  File "/home/aaron/qa-portal-venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3082, in _call_aside
    f(*args, **kwargs)
  File "/home/aaron/qa-portal-venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3111, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/home/aaron/qa-portal-venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 575, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/home/aaron/qa-portal-venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 588, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/home/aaron/qa-portal-venv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 777, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pylint==1.8.3' distribution was not found and is required by the application
        at com.intellij.openapi.diagnostic.Logger.error(Logger.java:123)
        at com.leinardi.pycharm.pylint.plapi.PylintRunner.isPylintPathValid(PylintRunner.java:98)
        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)
2018-10-23 09:34:17,314 [  51498]  ERROR - harm.pylint.plapi.PylintRunner - PyCharm 2018.2.1  Build #PY-182.3911.33
2018-10-23 09:34:17,315 [  51499]  ERROR - harm.pylint.plapi.PylintRunner - JDK: 1.8.0_152-release
2018-10-23 09:34:17,315 [  51499]  ERROR - harm.pylint.plapi.PylintRunner - VM: OpenJDK 64-Bit Server VM
2018-10-23 09:34:17,315 [  51499]  ERROR - harm.pylint.plapi.PylintRunner - Vendor: JetBrains s.r.o
2018-10-23 09:34:17,315 [  51499]  ERROR - harm.pylint.plapi.PylintRunner - OS: Linux
2018-10-23 09:34:17,315 [  51499]  ERROR - harm.pylint.plapi.PylintRunner - Last Action:
2018-10-23 09:34:17,315 [  51499]   INFO - harm.pylint.plapi.PylintRunner - Command Line string: /home/aaron/qa-portal-venv/bin/python /usr/bin/pylint --help-msg E1101
2018-10-23 09:34:17,315 [  51499]  ERROR - harm.pylint.plapi.PylintRunner - Pylint path check process.exitValue: 1
java.lang.Throwable: Pylint path check process.exitValue: 1
        at com.intellij.openapi.diagnostic.Logger.error(Logger.java:123)
        at com.leinardi.pycharm.pylint.plapi.PylintRunner.isPylintPathValid(PylintRunner.java:107)
        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)
2018-10-23 09:34:17,316 [  51500]  ERROR - harm.pylint.plapi.PylintRunner - PyCharm 2018.2.1  Build #PY-182.3911.33
2018-10-23 09:34:17,316 [  51500]  ERROR - harm.pylint.plapi.PylintRunner - JDK: 1.8.0_152-release
2018-10-23 09:34:17,316 [  51500]  ERROR - harm.pylint.plapi.PylintRunner - VM: OpenJDK 64-Bit Server VM
2018-10-23 09:34:17,316 [  51500]  ERROR - harm.pylint.plapi.PylintRunner - Vendor: JetBrains s.r.o
2018-10-23 09:34:17,316 [  51500]  ERROR - harm.pylint.plapi.PylintRunner - OS: Linux
2018-10-23 09:34:17,316 [  51500]  ERROR - harm.pylint.plapi.PylintRunner - Last Action:
2018-10-23 09:34:17,434 [  51618]   INFO - j.ide.plugins.RepositoryHelper - using cached plugin list (updated at 23/10/18 8:50)
leinardi commented 5 years ago

Hi @e2m4n, looks like you are using a venv (/home/aaron/qa-portal-venv/bin/python) but you are trying to run pylint fro /usr/bin/pylint. Can you please try to install pylint also on your venv and point the plugin to the venv pylint binary? Unfortunately PyLint need to be installed on the same environment you are using to run your code in PyCharm.

e2m4n commented 5 years ago

Hi @leinardi , that's exactly my problem - I already have pylint installed in my virtualenv, but the plugin appears to be trying to load pyint from /usr/bin instead. I'm not sure why it's not detecting my virtualenv version.

What I think is happening, looking at the log, is that the plugin is detecting /usr/bin/pylint in the first line. Then, it's calling the virtualenv's python, passing the system's pylint to it. When this system pylint starts, it tries to import load_entry_point from the virtualenv's pkg_resources module, which fails because it finds the virtualenv's version of pylint, and the version numbers don't match. (My system's pylint is 1.8.3 and my virtualenv's is 1.9.2)

Could it be that the pylint detection phase chooses a system pylint (if one exists) with greater priority than the virtualenv's pylint?

leinardi commented 5 years ago

Could it be that the pylint detection phase chooses a system pylint (if one exists) with greater priority than the virtualenv's pylint?

That's not the case, the system pylint is the very last option: https://github.com/leinardi/pylint-pycharm/blob/4af2fe58d7edc3c3d187d538b6bd4308493f32f7/src/main/java/com/leinardi/pycharm/pylint/plapi/PylintRunner.java#L144

The order is:

  1. User specified path
  2. venv path
  3. system path

Can you try to specify manually the path (Path to PyLint executable) pointing to the binary inside the same venv PyCharm is using and press the Test button? image

If you are getting a failure please attach the updated idea.log file here.

e2m4n commented 5 years ago

Yes it works when I set it manually. Although that now shows a separate issue: the setting is shared between all my projects, even though in the plugin settings dialog it says "For current project".

Could the failure to auto-detect be that your isVenv function (ref) is returning false because my virtualenv's path doesn't contain the text "/venv/" ?

leinardi commented 5 years ago

Although that now shows a separate issue: the setting is shared between all my projects, even though in the plugin settings dialog it says "For current project".

This is really strange, because the settings are stored inside the .idea folder of each project, I can't imagine how they can be shared unless you are sharing also this folder.

Could the failure to auto-detect be that your isVenv function (ref) is returning false because my virtualenv's path doesn't contain the text "/venv/" ?

This can definitely be the reason. PyCharm creates always a venv folder when you add a new virtual environment using its wizard. I am not sure how can I reliably check if the current environment is a virtual one or not. I am open to suggestions.

e2m4n commented 5 years ago

I'll double-check the settings thing - I use i3 window manager and Pycharm doesn't always follow the focus of the window manager.

Could isVenv check instead for a python executable? Or would that get complicated due to cross-platform differences?

leinardi commented 5 years ago

Could isVenv check instead for a python executable?

But the python executable will be there also if the environment is the system one, so I won't be able to actually make a distinction between system and virtual.

e2m4n commented 5 years ago

Hmmm, what about the activate script alongside python? That's something that should exist in a virtualenv but not in system.

leinardi commented 5 years ago

Yeah, that could be a good alternative I think :+1:

AlphaJi commented 5 years ago

Hi @e2m4n, looks like you are using a venv (/home/aaron/qa-portal-venv/bin/python) but you are trying to run pylint fro /usr/bin/pylint. Can you please try to install pylint also on your venv and point the plugin to the venv pylint binary? Unfortunately PyLint need to be installed on the same environment you are using to run your code in PyCharm.

I've the same problem. Now, I just set the pylint executable manually to my venv path.

rohith94 commented 5 years ago

Hi @leinardi is the fix updated .?

leinardi commented 5 years ago

Hi @rohith94, sorry for the delay. I have implemented a fix for the venv check. Could you please try it out and let me know if works fine for you? pylint-plugin-0.10.2.zip

If you get any error please attach the idea.log file here.

richbobo commented 5 years ago

I installed the pylint-plugin-0.10.2 update in PyCharm 2018.3 and it is working. No errors! Thanks!

EricRFMA-ES commented 5 years ago

I've upgraded to 2018.3 also, installed the pylint-plugin-0.10.2.zip via the link above, and I'm still having issues... This appears in the event log:

17:06   Unexpected Exception Caught
            The scan failed due to an exception: An error occurred while scanning a file.
            Root cause:
            com/squareup/moshi/Moshi$Builder
            java.lang.NoClassDefFoundError: com/squareup/moshi/Moshi$Builder
            at com.leinardi.pycharm.pylint.plapi.PylintRunner.scan(PylintRunner.java:276)
            at com.leinardi.pycharm.pylint.checker.ScanFiles.scan(ScanFiles.java:108)
            at com.leinardi.pycharm.pylint.checker.ScanFiles.checkFiles(ScanFiles.java:100)
            at com.leinardi.pycharm.pylint.checker.ScanFiles.call(ScanFiles.java:74)
            at com.leinardi.pycharm.pylint.PylintInspection.inspectFile(PylintInspection.java:88)
            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.co... (show balloon)

But then if I hover my mouse over the tiny exclamation point on the bottom of the window it tells me IDE internal error occured. If I click on the exclamation point, I get a different traceback:

java.lang.Throwable: Error while checking Pylint path: Using config file /Users/efeigenson/.pylintrc
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:134)
    at com.leinardi.pycharm.pylint.plapi.PylintRunner.isPylintPathValid(PylintRunner.java:99)
    at com.leinardi.pycharm.pylint.plapi.PylintRunner.checkPylintAvailable(PylintRunner.java:177)
    at com.leinardi.pycharm.pylint.plapi.PylintRunner.checkPylintAvailable(PylintRunner.java:151)
    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)

I'm puzzled by the reference to moshi. It's in the lib folder of the pylint-plugin folder, but there doesn't seem to be anyway to install it.

Can you help?

no-response[bot] commented 5 years ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

ShayHummel commented 5 years ago

I am experiencing the same issue. Some details: Pycharm: 2018.3.3 OS: Ubuntu 16.04 Pylint: V0.10.2

The error I am getting is: java.lang.Throwable: Error while checking Pylint path: No config file found, using default configuration at com.intellij.openapi.diagnostic.Logger.error(Logger.java:134) at com.leinardi.pycharm.pylint.plapi.PylintRunner.isPylintPathValid(PylintRunner.java:99) at com.leinardi.pycharm.pylint.plapi.PylintRunner.checkPylintAvailable(PylintRunner.java:177) at com.leinardi.pycharm.pylint.plapi.PylintRunner.checkPylintAvailable(PylintRunner.java:151) 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)

log file logs-20190124-114106.zip is attached.

In addition i defined a pylint.rc file (configuration file) which includes a custom plugin (load-plugins=my_linter). The file my_linter.py is located inside my project dir: ~/PyCharmProjects/backend/my_linter.py. However, when I try to run the plugin (by clicking on the play) it ends very fast. When removing this configuration file the linter runs.

s-kam commented 4 years ago

I am experiencing the same issue. Some details: Pycharm: 2019.2.1 Community edition OS: Windows Server 2012 R2 Pylint: V0.11.0

The error I am getting is: java.lang.Throwable: Pylint path detect process.exitValue: 1 at com.intellij.openapi.diagnostic.Logger.error(Logger.java:145) at com.leinardi.pycharm.pylint.plapi.PylintRunner.detectSystemPylintPath(PylintRunner.java:219) at com.leinardi.pycharm.pylint.plapi.PylintRunner.getPylintPath(PylintRunner.java:145) at com.leinardi.pycharm.pylint.plapi.PylintRunner.getPylintPath(PylintRunner.java:121) at com.leinardi.pycharm.pylint.plapi.PylintRunner.checkPylintAvailable(PylintRunner.java:177) at com.leinardi.pycharm.pylint.plapi.PylintRunner.checkPylintAvailable(PylintRunner.java:151) 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:322) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) log file: idea.log

UPD: fixed by installing pylint separately with pip and linking it with a plugin in plugin settings

Martin4R commented 1 year ago

Had the same issue. PyCharm 2023.1.2 Community Edition Pylint 0.15.0

Solution Short: The solution was to refill the Pylint preferences.

Detailed: The Pylint preferences showed correctly the path to the executable and the path to the pylintrc. When pressing the "Test" button it showed success. Still, when triggering a pylint scan manually and also the realtime scan do not work and show an error. The solution was just re-select the same executable and same pylintrc as were already shown before and then pressing ok in the preference dialog. After that the realtime scan and manual scan started to work again.