Menu

errors and warnings in gutter

2009-03-30
2013-03-15
  • Chad Dombrova

    Chad Dombrova - 2009-03-30

    after resetting up my interpreter, the very useful errors and warnings that display in the gutter (next to the line numbers) and as red underlines in the text editor have all disappeared. ( btw, is this a pydev or a pydev extensions feature?  i have both so sometimes I get confused about which feature comes from what.)  There are still errors and warnings in the Problems view, but they do not display in the editor and there are suspiciously fewer than there were before.  How can I get this feature back?  I can never seem to get everything working in pydev at once.

    -chad

     
    • Fabio Zadrozny

      Fabio Zadrozny - 2009-04-01

      Hi, provided that you've set you project PYTHONPATH correctly, this should work (the code-analysis is provided by Pydev Extensions)

      Have you followed the steps to configure the PYTHONPATH at: http://fabioz.com/pydev/manual_101_root.html ?

      Cheers,

      Fabio

       
      • Chad Dombrova

        Chad Dombrova - 2009-04-01

        yes, i did.  here is exactly what i'm doing:

        -install eclipse 3.4.2
        -install pydev 1.4.4
        -install pydev extensions 1.4.4
        -restart eclipse
        -open eclipse to a brand new workspace
        -add and validate pydev extension license
        -add python 2.5 interpreter for osx: /System/Library/Frameworks/Python.framework/Versions/Current/Resources/Python.app/Contents/MacOS/Python
        -create new project
        -create new python file
        -add the following contents and save:

        import string

        def foo():
            print "foo"
           
        def bar():
           print "bar"
          
        this should produce two warnings:  one for inconsistent indent and one for unused import.  i get nothing.   not even warnings in the "problems" view. i restarted eclipse just to be sure.

        is there anything else i need to do?  do i have to setup pylint? 

        this is on osx 10.5.6

        i would really like to get this working, so just tell me what to try to troubleshoot this.

         
        • Fabio Zadrozny

          Fabio Zadrozny - 2009-04-01

          If you have Pydev Extensions, you don't need PyLint.

          Are your files under a source folder (i.e.: in the project pythonpath)?

          Cheers,

          Fabio

           
    • Chad Dombrova

      Chad Dombrova - 2009-04-01

      here are the further steps i have taken:
      -installed pylint and pointed pydev to lint.py:  /Library/Python/2.5/site-packages/pylint-0.18.0-py2.5.egg/pylint/lint.py
      - checked "use pylint"
      - added /Library/Python/2.5/site-packages  ( osx puts the system install at /System/Library/ and the user libs at /Library/ )
      - under project properites, I added the path to the current project ( /var/tmp/test ). afterwards, the "_module_not_in_pythonpath_" hover warnings were replaced with "press F2 for focus", but still no code analysis.

      In the year that I've been using pydev, the only time I've ever had code analysis working is when code completion was not working, and vice versa. I've been trying periodically to set both up throughout that time.

      -chad

       
    • Fabio Zadrozny

      Fabio Zadrozny - 2009-04-01

      Hummm... OK, let's see which path you'd rather take: do you want to setup to use the pydev extensions or the pylint code-analysis?

      Do you have some error in your error log?

      Cheers,

      Fabio

       
    • Chad Dombrova

      Chad Dombrova - 2009-04-01

      > Are your files under a source folder
      yes, my files are under the pythonpath.

      > do you want to setup to use the pydev extensions or the pylint code-analysis?
      which is better?  i'll take whichever one we can get to work....

      > Do you have some error in your error log?

      i get this one error:

      java.io.UnsupportedEncodingException: The encoding found: >>uft-8<< on /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/test/bad_coding.py is not a valid encoding.
      at org.python.pydev.core.REF.getValidEncoding(REF.java:881)
      at org.python.pydev.core.REF.getPythonFileEncoding(REF.java:853)
      at org.python.pydev.core.REF.getPythonFileEncoding(REF.java:777)
      at org.python.pydev.core.REF.getCustomReturnFromFile(REF.java:652)
      at com.python.pydev.analysis.additionalinfo.builders.InterpreterObserver.restoreInfoForModuleManager(InterpreterObserver.java:176)
      at com.python.pydev.analysis.additionalinfo.builders.InterpreterObserver.notifyDefaultPythonpathRestored(InterpreterObserver.java:61)
      at org.python.pydev.ui.interpreters.AbstractInterpreterManager.restorePythopathForAllInterpreters(AbstractInterpreterManager.java:463)
      at org.python.pydev.ui.pythonpathconf.PythonInterpreterPreferencesPage.doRestore(PythonInterpreterPreferencesPage.java:42)
      at org.python.pydev.ui.pythonpathconf.AbstractInterpreterPreferencesPage$1.run(AbstractInterpreterPreferencesPage.java:168)
      at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

      session data:

      eclipse.buildId=M20090211-1700
      java.version=1.5.0_16
      java.vendor=Apple Inc.
      BootLoader constants: OS=macosx, ARCH=x86, WS=carbon, NL=en_US
      Framework arguments:  -keyring /Users/chad/.eclipse_keyring -showlocation
      Command-line arguments:  -os macosx -ws carbon -arch x86 -keyring /Users/chad/.eclipse_keyring -consoleLog -showlocation

      -chad

       
    • Chad Dombrova

      Chad Dombrova - 2009-04-01

      i assume that this is a test file that is *supposed* to fail.  lib/python2.5/test/ is not on the PYTHONPATH, so i'm not sure why it's being parsed or imported.  for what it's worth, the same folder and file exists on my linux install as well.

      -chad

       
    • Chad Dombrova

      Chad Dombrova - 2009-04-02

      i assume that this is a test file that is *supposed* to fail.  lib/python2.5/test/ is not on the PYTHONPATH, so i'm not sure why it's being parsed or imported.  for what it's worth, the same folder and file exists on my linux install as well.

      -chad

       
    • Chad Dombrova

      Chad Dombrova - 2009-04-02

      well, i got the code analysis working, but now it has stopped respecting my python package as a forced builtin, so code completion has stopped working!  i can never get them both to work...

      it went down like this:

      i have a package called pymel that works with Maya ( a 3d app ) and it must be treated as a builtin.  it relies on external libs, so in order to work it needs some environment variables setup ( on osx: DYLD_FRAMEWORK_PATH and DYLD_LIBRARY_PATH )  i set those up in pydev prefs under my main dev workspace using eclipse 3.5M6

      in the meantime, i had my super clean 3.4.2 pointing to /var/tmp and i still wasn't getting any code analysis.  i had already closed and reopened eclipse, then closed and reopened the file hoping that would force the analysis, but it did not. i played around with various settings, then i realized that i had to actually modify (and possible re-save) the file in order to trigger code analysis to work for that file.   so who knows what change i made to trigger this to work.

      so, realizing this, i went back to eclispe 3.5, changed a file and boom, i got code analysis.  and i had completion for pymel working too!  so i closed eclipse3.5, switched 3.4 to my main workspace and.... no more completion for pymel.

      so bloody finicky. 

      when pymel is inspected it launches python in the background as a separate process on account of the fact that it requires and uses Maya's python frameworks.  this is no longer happening, so the code completion is not working right.

      i'll keep messing with this.  one of these years i'm going to get this right.  or give up...

      -chad

       
      • Fabio Zadrozny

        Fabio Zadrozny - 2009-04-02

        Well, if you're using PyLint, yes, it only analyzes on save (if it's for Pydev Extensions, it can analyze an open editor).

        > when pymel is inspected it launches python in the background as a separate process on account of
        > the fact that it requires and uses Maya's python frameworks. this is no longer happening, so the code
        > completion is not working right.

        Just checking: do you have 'pymel' in the forced builtins and have the environment variables you said specified in your interpreter? Could it be that it also needs some other environment variable?

        Cheers,

        Fabio

         
    • Chad Dombrova

      Chad Dombrova - 2009-04-02

      i assume that this is a test file that is *supposed* to fail.  lib/python2.5/test/ is not on the PYTHONPATH, so i'm not sure why it's being parsed or imported.  for what it's worth, the same folder and file exists on my linux install as well.

      -chad

       
    • Chad Dombrova

      Chad Dombrova - 2009-04-02

      pymel is a package, so i have some of the key submodules in builtins:

      pymel.core.nodetypes
      pymel.core.animation
      pymel.core.general

      i also have the directory above the pymel package in the system libs.

      previously, when i had this working, it worked best if i only used leaf modules.  i.e. not pymel.core or just pymel.  do you have any advice on which to include as builtins?

      the thing that i don't understand is it WAS working.  the autocompletion was finding objects that it could only have found if it was inspecting the module, not just parsing it.  i could see the second python process spawn in my dock. now nothing...

      is there any possibility of one feature preventing the other from working?

      -chad

       
    • Chad Dombrova

      Chad Dombrova - 2009-04-02

      eureka!  it's working in eclipse3.4.2 + pydev1.4.4.  and eclipse3.5 + pydev1.4.5

      wow, what a delicate flower this is.  i will analyze very carefully the minimum steps to get this working and what breaks it and report back here.  i currently have pylint turned off, so that may have been important.  changing and saving the file to trigger an update of code analysis was definitely key to troubleshooting this: otherwise i was ending up with false negatives all the time.

      -chad

       
    • Chad Dombrova

      Chad Dombrova - 2009-04-02

      while trying to make a tutorial on how to do this, it broke again.  I deleted the interpreter and tried to set it up again exactly as it was. I get the following error over and over. 

      org.eclipse.core.runtime.CoreException: Info still not set
          at org.python.pydev.plugin.PydevPlugin.log(PydevPlugin.java:315)
          at org.python.pydev.editor.codecompletion.revisited.ProjectModulesManager.getSystemModulesManager(ProjectModulesManager.java:210)
          at org.python.pydev.editor.codecompletion.revisited.ProjectModulesManager.getManagers(ProjectModulesManager.java:418)
          at org.python.pydev.editor.codecompletion.revisited.ProjectModulesManager.getManagersInvolved(ProjectModulesManager.java:514)
          at org.python.pydev.editor.codecompletion.revisited.ProjectModulesManager.resolveModule(ProjectModulesManager.java:343)
          at org.python.pydev.editor.codecompletion.revisited.ProjectModulesManager.resolveModule(ProjectModulesManager.java:336)
          at org.python.pydev.plugin.nature.PythonNature.resolveModule(PythonNature.java:793)
          at org.python.pydev.plugin.nature.AbstractPythonNature.resolveModule(AbstractPythonNature.java:37)
          at org.python.pydev.plugin.nature.AbstractPythonNature.isResourceInPythonpath(AbstractPythonNature.java:21)
          at com.python.pydev.analysis.builder.AnalysisParserObserver.parserChanged(AnalysisParserObserver.java:87)
          at org.python.pydev.parser.PyParser.fireParserChanged(PyParser.java:339)
          at org.python.pydev.parser.PyParser.reparseDocument(PyParser.java:450)
          at org.python.pydev.parser.ParserScheduler.reparseDocument(ParserScheduler.java:150)
          at org.python.pydev.parser.ParsingThread.run(ParsingThread.java:46)
      Caused by: java.lang.RuntimeException: Info still not set
          at org.python.pydev.plugin.PydevPlugin.log(PydevPlugin.java:314)
          ... 13 more

      I ended up having to delete my entire .metadata for this workspace, which set me back quite awhile resetting everything up.

      But even after doing that I could no longer setup my interpreter as normal.  As soon as I set it up -- in exactly the same way that I have on my other machine and that I used to have here -- eclipse locks up on startup.

      I really like pydev, but it's at times like these.... grrr.   I've dedicated 2 days just to figuring this out.  It works, it breaks.  I fix it. It breaks...

       
      • Fabio Zadrozny

        Fabio Zadrozny - 2009-04-02

        Which Pydev version is that? Are you trying with 1.4.5? There was an error like that in 1.4.4 which was misleading (1.4.5 fixed it), in which you had an interpreter configured for your project but that interpreter was not actually available in the preferences.

        Cheers,

        Fabio

         
    • Chad Dombrova

      Chad Dombrova - 2009-04-08

      it was with 1.4.4.

      i've got everything working now. whew!