Coder Social home page Coder Social logo

DPS Graph window does not load about pyfa HOT 18 CLOSED

pyfa-org avatar pyfa-org commented on July 18, 2024
DPS Graph window does not load

from pyfa.

Comments (18)

blitzmann avatar blitzmann commented on July 18, 2024

Does anything happen? Pyfa crash? Or the window just not load?

from pyfa.

TheAtomicOption avatar TheAtomicOption commented on July 18, 2024

Nothing happens. No crash. Pyfa continues to function normally. Window just doesn't load.

from pyfa.

DarkFenX avatar DarkFenX commented on July 18, 2024

Try launching pyfa from console and see if it prints "Problems importing matplotlib; continuing without graphs" there when you open graph. If it does, i will explain how to get more detailed data on import crash.

from pyfa.

TheAtomicOption avatar TheAtomicOption commented on July 18, 2024

Opened cmd and ran pyfa. Only output was a blank line before I got the prompt back (and the pyfa window).

Pyfa runs as before (no graphs). I'm assuming this means matplotlib is at least loading on app start? so I have that going for me which is nice.

from pyfa.

blitzmann avatar blitzmann commented on July 18, 2024

Ran the exe from console? Is it possible to run it from source on python2? I also run Win7 and the latest version of Pyfa with no trouble with the DPS graph =(

from pyfa.

TheAtomicOption avatar TheAtomicOption commented on July 18, 2024

Oh! ♿ Ok! Installed python, everything listed in the readme, and managed to get python running from source...

The first attempt to open a graph produces: "Problems importing matplotlib; continuing without graphs"

Further attempts to open a graph produce:

    Traceback (most recent call last):
      File "C:\Program Files (x86)\pyfa\.\gui\mainFrame.py", line 542, in openGraphFrame
        self.graphFrame.SetFocus()
      File "wx\_core.pyo", line 9301, in SetFocus

    TypeError: in method 'Window_SetFocus', expected argument 1 of type 'wxWindow *'

Note: (this was copied from the log file, see below, so the path is different than my copy of the source)

Also I noticed that error_log.txt and output_log.txt are not written until Pyfa is closed. So I tried running from the .exe again and after attempting to open a graph and then closing Pyfa these same errors are written to the logs.

from pyfa.

DarkFenX avatar DarkFenX commented on July 18, 2024

Do you have any other alternative installations of wxwidgets / wxpython?

This error should never happen if bundled versions are used, to my understanding.

from pyfa.

TheAtomicOption avatar TheAtomicOption commented on July 18, 2024

No. I've never installed them before just now to run pyfa from source, but of course the issue was present before that.

The bundled libraries are definitely present in the pyfa directory. I always unzip/copy+replace the entire pyfa directory when a new version comes out, so the version in the pyfa directory should be ok. Does pyfa not use those copies by default over libraries installed elsewhere?

What should be my next debug steps be?

from pyfa.

blitzmann avatar blitzmann commented on July 18, 2024

Well, if it fails to import the module for wahtever reason, it seems to still set self.graphFrame to something. Then upon subsequent tries to open the window it fails because, well, it failed the first time and set self.graphFrame to an incorrect value. That should be fixed.

As to why it's not importing in the first place... I have no idea. I'll try to look into it further. Can you do me a favor though? I'm interested in seeing what exactly self.graphFrame is being set to after failing to import.

This is the block that's not working for you:

def openGraphFrame(self, event):
    if not self.graphFrame:
        self.graphFrame = GraphFrame(self)
        if gui.graphFrame.enabled:
            self.graphFrame.Show()
    else:
        self.graphFrame.SetFocus()

Since pyfa is setting self.graphFrame upon failutre, it is no longer None and thus will try to set focus to the non-existent window.

In the source files (not the bundled release), open gui/mainFrame.py and find that block (towards the bottom). Right under def openGraphFrame(self, event):, add print self.graphFrame making sure that the indentation is correct.

That will print the contents of self.graphFrame to the console. Then run from the console with python path/to/pyfa.py. Let pyfa load, and then try to open the graph window. What pops up in the console? Try to open the window again and see what it's being set to. Document your steps and let us know. =)

from pyfa.

TheAtomicOption avatar TheAtomicOption commented on July 18, 2024

Ok updated mainFrame.py, new output on first attempt to graph

None
Problems importing matplotlib; continuing without graphs

as expected. Subsequent attempts to open the graph output:

<gui.graphFrame.GraphFrame;   >
Traceback (most recent call last):
    File "[irrelevant path]\Pyfa\gui\mainFrame.py", line 543, in open GraphFrame
       self.graphFrame.SetFocus()
    File "C:\Python27\lib\site-packages\wx2.8-msw-unicode\wx\_core.py", line 9304, in SetFocus
       return _core_.Window_SetFocus(*args, **kwards)
TypeError: in method 'Window_SetFocus', expected argument 1 of type 'wxWindow *'

so it looks like it's setting it to <gui.graphFrame.GraphFrame; >

Other things I thought about printing (like the exception code in graphFrame.py didn't turn out well because I don't know what I'm doing. 😄

from pyfa.

blitzmann avatar blitzmann commented on July 18, 2024

Yeah, it's just setting it to the GraphFrame class. I figured as much. Lets try to print out the exception message. Right now it catches the exception, but just prints out "Problem importing yada yada"

In gui/graphFrame.py, find the block with that error message:

    except:
        print "Problems importing matplotlib; continuing without graphs"
        enabled = False
        return

Replace with:

    except Exception, e:
        print e.__doc__
        print e.message
        return

(again, make sure indentation is correct)

That will let us know what exactly is failing. If it's a failure to find the module, then I have no idea how to fix that as it should be bundled.

from pyfa.

TheAtomicOption avatar TheAtomicOption commented on July 18, 2024

Ok! error is:

Import can't find module, or can't find name in module.
matplotlib requires dateutil
Traceback (most recent call last):
    File "[irrelevant path]\pyfa\gui\mainFrame.py", line 541, in openGraphFrame
        self.graphFrame.Show()
    File "C:\python27\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 9143, in Show
        return _core_.Window_Sohw(*args, **kargs)
TypeError: in method 'Window_Show', expected argument 1 of type 'wxWindow *'

looks like the traceback is from getting rid of enabled = False, so pyfa attempts to Show() the window despite not loading mathplotlib or finishing init

so I need dateutil?

As expected, attempting to open a graph the 2nd time produces the same error as before since we only run init at creation of an instance.

from pyfa.

blitzmann avatar blitzmann commented on July 18, 2024

Yeah, it seems that, for whatever reason, dateutil isn't loading for you. Weird.

Go ahead and add enabled = False back to the exception catch block. Keep the code that prints exceptions because we want to see if it still has issues. Add import dateutil to the other imports at the top of gui/graphFrame.py and see if it works then

from pyfa.

TheAtomicOption avatar TheAtomicOption commented on July 18, 2024

I tried adding it at both the top and bottom of the stack of imports before the GraphFrame class begins in graphFrame.py. This caused Pyfa to not start at all. I get Traceback and ImportError: No module named dateutil

I used the github app to download this source, so I should have everything. Should there be a dateutils.py somewhere?

from pyfa.

TheAtomicOption avatar TheAtomicOption commented on July 18, 2024

Update: I found an installer for python-dateutils 2.2 for py2.7 and used it. Now I'm getting matplotlib requires pyparsing. I'll see if I can find that also. Still puzzling.

from pyfa.

TheAtomicOption avatar TheAtomicOption commented on July 18, 2024

I just deleted my c:\program files (x86)\pyfa\ directory again and reinstalled using the exe. Graphs work. I've tried that before without success. Really puzzled, but I won't argue with victory.

Running pyfa from source still gives me the matplotlib requires pyparsing error, but if you don't want to keep debugging that I understand.

Either way, thanks very much for your time helping me through this!

from pyfa.

blitzmann avatar blitzmann commented on July 18, 2024

wtf. Agree'd really weird.

The source pyfa runs off the python interpreter that you installed, whereas the bundled pyfa come with it's own python and all the python modules needed (which is why it was perplexing that it didn't work). They are separate, the interpreter that you installed requires you to manually install the dependencies.

Glad you got it working. Go ahead and close the issue please. o7

from pyfa.

DarkFenX avatar DarkFenX commented on July 18, 2024

I think it has something to do with python using obsolete .pycs (happens sometimes, to my knowledge, although it compares src & pyc using timestamp so this is unlikely to happen).

Glad that you sorted this.

from pyfa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.