-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tkgui not working (topoconsole doesn't appear) #611
Comments
When I update to the most recent version, I get 0.9.8-1343-g1c6dc94. Maybe you're on a branch? BTW, to get the version number more easily, I just added a commandline option:
|
Sorry, I was just trying to record some historical info: I had a version where the gui was working fine, I did a git pull/git submodule update (i.e. only git operations), then the gui no longer worked. That version could well be on a branch, and some time I'll confirm that (and could map back to nearest ioam/topographica's master commits, to help track down the problem if necessary). I had the same problem (topoconsole window not expanding) when I did a fresh clone of the most recent version of github/ioam/topographica on an Ubuntu 12 machine, using anaconda. And it sounds like Jan had the problem on a fresh clone on Ubuntu 14 (using the system python). But I guess you're saying this problem doesn't happen for you? Interesting. Just for the record, here's what I did (as sent to Jan): (set up python environment) (install git topographica) Then I tried the GUI: This results in a topoconsole that's not expanded. I noticed that |
By the way, I just followed the README's clone instructions (except for using https) and |
Also, |
Honestly, I have no idea what you are talking about! ./topographica --version
Usage: topographica ([<option>]:[<filename>])*
where any combination of options and Python script filenames will be
processed in order left to right.
topographica: error: no such option: --version This is because EDIT: I skimmed the above and missed the fact that Jim has just added this feature! ./topographica --help
Usage: topographica ([<option>]:[<filename>])*
where any combination of options and Python script filenames will be
processed in order left to right.
Options:
-h, --help show this help message and exit
-i, --interactive provide an interactive prompt even if stdin does not
appear to be a terminal.
-v, --verbose enable verbose messaging output
-d, --debug enable debugging message output (implies --verbose)
-l, --legacy launch Topographica with legacy support enabled
-o "<output-path>", --outputpath="<output-path>"
set the default output path
-g, --gui launch an interactive graphical user interface;
equivalent to -c 'from topo.misc.commandline import
gui ; gui()'. Implies -a.
--pdb Automatically call the pdb debugger after every
uncaught exception. See IPython documentation for
further details.
-c "<command>", --command="<command>"
string of arbitrary Python code to be executed in the
main namespace
--ip=IP Store the provided notebook IP.
--port=PORT Store the provided notebook port.
-n, --notebook launch the IPython Notebook interface
-p <param>=<value>, --set-parameter=<param>=<value>
command specifying value(s) of script-level (global)
Parameter(s).
-a, --auto-import-commands
import everything from commands/*.py into the main
namespace, for convenience; equivalent to -c 'from
topo.misc.commandline import auto_import_commands ;
auto_import_commands()'.
-t <testname>, --test=<testname>
name of test to run (use '-t list' to show tests
available). But >>> import topo
>>> topo.__version__
Version((0, 9, 8),'/user/home/topographica/topo/__init__.pyc','6112f71') What is the particularly concern with versioning right now? |
That is correct. The tag 'CNV' doesn't follow the convention for versioning e.g. |
I've known about the GUI issue for a while but until recently it only occurred on one of my 3 machines. I vaguely remember it having something to do with the interaction between Tk and matplotlib but I might be completely wrong. I looked into it again when Jan reported having this issue but haven't made any progress. Will have another look now. |
@philippjfr: anything like this could also be related to ancient tk hacks that originated from me, so if you determine what change caused the problem but it doesn't make any sense to you, let me know. @jlstevens: you missed Jim's commit adding |
So is my problem with $ git describe
CNV-2014-701-g1c6dc94 Meaning I don't get git information in >>> import topo; topo.__version__
Version((0, 9, 8),'/home/ceball/tmp/topographica/topo/__init__.pyc',None) How come that doesn't happen for you and Jim? (This is on a fresh clone.) |
Managed to fix this issue by creating a matplotlibrc file setting the backend to agg like this:
I'm still getting some issues with Pillow on this machine so I can't test everything else works. However based on this fix I'm almost certain this is a weird interaction between holoviews and the GUI. Importing matplotlib in holoviews is probably occurring before the GUI is launched and selecting |
Show me the output of Obviously, we aren't going to use any arbitrary git tag, no matter how recent. It doesn't matter what the last tag is set to unless it follows the appropriate convention for version format (in which case it will be used). The This should take you less than five minutes to figure out. We can fix |
output of git tag:
Ok, you've sold me - I'll investigate...but only because my viva's been cancelled (was tomorrow)!
It's happening with fresh clones on Ubuntu 12 and DICE, so I'd be surprised if it's not affecting other people too - but it's possible (particularly since it's not easy to get current topographica running on either of those platforms at the moment...). |
Ah, I see what the confusion was. Git describe does indeed use CNV-2014, because that's the last tag, but
So Chris and I are both using the same version, and he's getting GUI problems and I am not (this version works fine for me). He also seems to be having problems with getting the right information from |
Could we move discussion of the versioning stuff somewhere else if there's anything more to discuss? @ceball: Does setting the backend to agg fix your GUI issues? |
Yes, doing |
(Although of course now matplotlib plots don't display for me in the GUI.) |
Great! We've had a lot of problems fighting matplotlib backends. I wouldn't be against adding such a Hopefully we can decide whether we want to include this file then close this issue. Unfortunately, it seems another matpotlib issue has cropped up while typing this. :-( |
Hmm, yea it's not surprising that the Tk GUI can't display matplotlib windows if the backend is set to agg. Just found a fix though, in |
Except for with the tk gui, right? Or am I confused? I moved the version stuff to holoviz/param#70 and will deal with that myself. |
Ah, saw Philipp's message after I'd written mine. Yes, with the previously mentioned |
No that's correct, the GUI will have to use TkAgg for obvious reasons but we can enforce that using the @ceball: Great, if there's no objections I'll replace the previous rcParam based backend settings with the call to plt.switch_backend. Then we'll just have to add a strong recommendation to select |
I said that because I never use the Tk GUI anymore (I keep forgetting it exists) and we want Agg for everything else (IPython Notebook). Philipp's suggestion of using Agg by default and switching to TkAgg when launching the TK GUI in commandline seems ideal. @philippjfr Another post that appeared while writing this! Your suggestion seems fine - I would prefer for the code approach instead of a matplotlibrc file myself... |
@jlstevens I agree, only mentioned the matplotlibrc because I only figured out the |
Just to catch myself up to date -- I strongly argue against any solution based on matplotlibrc; Topographica should not be recommending that people mess with that, should not be depending on what is in that file, and should not be changing that file itself. Topographica, as a full standalone application that uses matplotlib internally, should be setting the backend as necessary for its own use (just as suggested by Philipp), and otherwise not mess with anything or depend on anything. What holoviews should do is less clear, because it's a library rather than an application, and needs to fit into multiple possible workflows. But having it use Agg internally seems fine, as long as Topographica can switch the backend to TkAgg as needed. We've been dealing with matplotlib backend issues for so many years that I can't bear to work on those again, but it seems like we have to. :-( |
Okay my concrete suggestions are as follows:
|
Sounds good. @ceball and @antolikjan, please check that it works ok after Philipp's change, and everyone else can check that notebooks, etc. work as desired. |
Hello everybody, just an update on the current situation. I just did a completely fresh I also tried to install topographica within a virtualenv, with all the Best, The current bug: WARNING:root:Time: 000002.05 TopoConsole00345: (AttributeError) cos On Tue, Dec 9, 2014 at 3:50 AM, James A. Bednar notifications@github.com
|
@antolikjan Are you using the
As I use virtualenvwrapper, I be would using something like this instead:
This should expose all the functionality available on your system by default while also giving you control over where any new packages go. In addition, you can shadow the system packages with different versions if you need. |
Just an update: I've tried the latest version, but the topoconsole doesn't expand. However, if I have the matplotlibrc file ( |
I've moved Jan's problem to #613. Good luck over there Jan :) |
If I don't have the matplotlibrc, the topoconsole doesn't expand, as I said. If I put a |
Sorry, I'm catching up here. Is the difference in behavior we're seeing (topoconsole expands for some, not for others) down to different binary distributions of matplotlib having different default backends (as chosen by whoever made the binary)? Where topoconsole expands, maybe agg is already the default backend, and where topoconsole does not expand, maybe agg is not the default backend? Anyway, I found that the latest I can put |
Just a note that on this copy of python (anaconda python) where the topoconsole doesn't expand (without one of the workarounds above), if I start python and do |
Sorry to keep posting - I keep thinking I've stopped working on this! |
Or tkagg, of course. |
With the current git topographica, the topoconsole also does not expand on doozy (ubuntu 14.04, using the system python). The default backend there seems to be Qt4Agg too. On hebb, which is the machine with |
Ok, I promise I've finished reporting stuff now. I could actually attempt to fix the problem, but not until the middle of next week or so. For Topographica, I think matplotlib's backend has to be set to a non-gui one (i.e. agg for us) using In |
Thanks for looking into this Chris. I did think it was likely to still be broken without adding |
I've just been thinking. The real cause of this is that when importing holoviews the ipython extension and plotting code are automatically imported and both initialize pyplot. Elsewhere we have been discussing supporting different levels of dependencies, in particular to ensure we don't require matplotlib. Implementing that should be enough to address this issue. |
Maybe your matplotlib has a non-gui or tkagg default backend? The reason I didn't just commit a change like putting |
Philipp, I've just seen your post after submitting mine. (Github needs a conversation update notification like gmail's...) I was wondering if the dependencies were intentional or not - now I know you're discussing the dependencies, I see it makes sense to leave this issue until that's been done. Thanks! |
It sounds like this is coming to some sort of a conclusion. I agree, Topographica and its tkgui should not require Matplotlib just to load, and preferably should not be loading it unless it is actually about to be used (in a tkgui plot or in an IPython notebook). We don't want to have to debug anything to do with Matplotlib or its backends on any system, unless we are actually using Matplotlib. So, yes, Philipp, please do make holoviews not require Matplotlib in its core, and please make Imagen rely only on the core of holoviews, not anything to do with plotting. That should be a big help in eliminating problems like this. And it sounds like it should fix this specific issue of having tkgui problems that vary by system. That said, I'm not sure it's enough to fix everything -- won't we still need to specify Agg somewhere for when tkgui is not in use? I guess that you can do that in the non-core parts of holoviews, so that if anyone imports those, Matplotlib will use an Agg backend, if anyone runs the tkgui it will use a TkAgg backend, and otherwise won't be loaded at all? Somehow we still do need an Agg backend for run_batch, right, which is neither of these cases? |
I am not sure where this issue's conclusion was at, but i just want to note that with latest topographica on github as on yesterday 17 Oct 2015:
|
Just pushed a fix for this along with a fix for the projections in the GUI. Could you pull the latest version of Topographica along with the submodules and report back? |
Thanks Philipp. I just pulled a fresh clone. Plotting is ok now, but i still get key error when i try to plot projections (e.g. ./topographica -g ./examples/gcal.ty). Here the trace when i tried to plot LGN and V1 projections. [143][marwan@synapse:topographica]> ./topographica -g ./examples/gcal.ty Welcome to Topographica! Type help() for interactive help with python, help(topo) for general <IPython.core.display.HTML object> topo_t000000.00_c1>>> WARNING:root:Time: 000001.00 TopoConsole01074: (KeyError) 'Afferent' |
Seems like I can reproduce it now at least. Seems to work fine for tiny.ty but not for gcal.ty. Hopefully I'll have a fix soon. |
Great, that helps :) |
I was at CNV-2014-638-ga3ab76f and
./topographica -g
worked fine. I updated to the most recent version (CNV-2014-700-g6112f71) and now./topographica -g
gives me a topoconsole window that's not expanded. If I typetopo.guimain.mainloop()
the topoconsole expands but then I can't use the console any more.(likely to be irrelevant from here on...) I'm using anaconda python 2.1.0 on DICE, but probably that's irrelevant, because Jan also reports the same problem on Ubuntu (not sure which version) using the system python. I tried to use DICE's python but I got a syntax error earlier on in the startup unrelated to this issue (DICE's python is too old, I guess? I tried
dice-pyenv CNV
too, but it saidEnvironment CNV could not be found
). I also tried to use Ubuntu 12's python, but I guess my matplotlib version is too old (ImportError: cannot import name rc_params_from_file) and when I didpip install --user --upgrade matplotlib
I got:I tried that command, but got
I didn't want to use sudo, so I tried the easy_install command again with
--user
and it worked (because I have ~/.local/bin on my path, I guess), so I tried to pip install matplotlib again but that failed with several pages of instructions...so I stopped there (I guess I need to install some libraries).The text was updated successfully, but these errors were encountered: