Discussion:
[Pyzo] Note on using QApplication.exec_():
w***@gmail.com
2016-08-01 10:19:51 UTC
Permalink
The GUI event loop is already running in the pyzo kernel, and exec_()
does not block. In most cases your app should run fine without the need
- Prevent deletion of objects in the local scope of functions leading to
exec_()
- Prevent system exit right after the exec_() call
Please can someone tell me:


1) If it's something I should worry about and

2) if there is some way of suppressing it? It is getting in the way of my
text output


Thanks


Will
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyzo+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Almar Klein
2016-08-08 12:57:01 UTC
Permalink
Post by w***@gmail.com
If it's something I should worry about
No. It’s mostly to warn people who use `sys.exit(app/exec_())` and are confused about what happens.
Post by w***@gmail.com
if there is some way of suppressing it? It is getting in the way of my text output
Currently no. But should be easy to add. Made an issue for it: https://github.com/pyzo/pyzo/issues/418

Regards,
Almar



From: ***@gmail.com
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyzo+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
r***@gmail.com
2016-11-13 00:14:12 UTC
Permalink
So, how can this get fixed or should we revert to earlier versions of IEP? I'm trying to walk someone through how python can replace matlab. I'm using pyzo, and this just makes things completely messy. My code worked fine in pyzo2014a. I have a ton of plotting things using matplotlib and now every matplotlib.pyplot.show() mixes this useless warning with the shell output text from all my programs. It's easy to see where this is in the IEP source. Look in iep.iepkernel.guiintegration, guiintegration.py

# Qt has its own message
mainloopWarning_qt = """
Note on using QApplication.exec_():
The GUI event loop is already running in the IEP kernel, and exec_()
does not block. In most cases your app should run fine without the need
for modifications. For clarity, this is what the IEP kernel does:
- Prevent deletion of objects in the local scope of functions leading to exec_()
- Prevent system exit right after the exec_() call
""".strip()+"\n"
Post by Almar Klein
Post by w***@gmail.com
If it's something I should worry about
 
No. It’s mostly to warn people who use `sys.exit(app/exec_())` and are confused about what happens.
 
 
Post by w***@gmail.com
if there is some way of suppressing it? It is getting in the way of my text output
 
Currently no. But should be easy to add. Made an issue for it: https://github.com/pyzo/pyzo/issues/418
 
Regards,
  Almar
 
 
 
Sent: 01 August 2016 12:19
To: Pyzo
 
 
 
The GUI event loop is already running in the pyzo kernel, and exec_()
does not block. In most cases your app should run fine without the need
- Prevent deletion of objects in the local scope of functions leading to exec_()
- Prevent system exit right after the exec_() call
 
 
1) If it's something I should worry about and
2) if there is some way of suppressing it? It is getting in the way of my text output
 
Thanks
 
Will
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
For more options, visit https://groups.google.com/d/optout.
 
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyzo+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Karl Rudnick
2016-11-14 21:24:58 UTC
Permalink
I could not live with this annoying message so I upgraded my pyzo2014a to
pyzo2015a via pyzo_distro-2015a.win64.zip at http://test.pyzo.org/
downloads.html. I understand that in 2016, the Pyzo folks are trying to
unlink the IDE from the actual Python environment, but the previous method
of simply putting everything together works best for newbies, especially if
you're holding someone's hand to convince them that they might be able to
live without Matlab. At the very least, you should fully test before
releasing this as a stable Matlab "equivalent." Else, people will be turned
off and won't come back.

Regards,
Karl Rudnick
Post by r***@gmail.com
So, how can this get fixed or should we revert to earlier versions of IEP?
I'm trying to walk someone through how python can replace matlab. I'm using
pyzo, and this just makes things completely messy. My code worked fine in
pyzo2014a. I have a ton of plotting things using matplotlib and now every
matplotlib.pyplot.show() mixes this useless warning with the shell output
text from all my programs. It's easy to see where this is in the IEP
source. Look in iep.iepkernel.guiintegration, guiintegration.py
# Qt has its own message
mainloopWarning_qt = """
The GUI event loop is already running in the IEP kernel, and exec_()
does not block. In most cases your app should run fine without the need
- Prevent deletion of objects in the local scope of functions leading to exec_()
- Prevent system exit right after the exec_() call
""".strip()+"\n"
Post by Almar Klein
Post by w***@gmail.com
If it's something I should worry about
No. It’s mostly to warn people who use `sys.exit(app/exec_())` and are
confused about what happens.
Post by Almar Klein
Post by w***@gmail.com
if there is some way of suppressing it? It is getting in the way of my
text output
https://github.com/pyzo/pyzo/issues/418
Post by Almar Klein
Regards,
Almar
Sent: 01 August 2016 12:19
To: Pyzo
The GUI event loop is already running in the pyzo kernel, and exec_()
does not block. In most cases your app should run fine without the need
- Prevent deletion of objects in the local scope of functions leading to
exec_()
Post by Almar Klein
- Prevent system exit right after the exec_() call
1) If it's something I should worry about and
2) if there is some way of suppressing it? It is getting in the way of
my text output
Post by Almar Klein
Thanks
Will
--
You received this message because you are subscribed to the Google
Groups "Pyzo" group.
Post by Almar Klein
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the
Google Groups "Pyzo" group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/pyzo/BGLZtX1lz74/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyzo+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
a***@gmail.com
2016-11-16 09:35:43 UTC
Permalink
Dear Karl,

I understand that the message is annoying if it occurs multiple times. However, the fact that it is there is deliberate; it is printed when Pyzo detects that a mainloop is being started. Pyzo’s GUI integration makes such a call non-blocking, which can cause problems, which will be extremely annoying if you don’t understand the situation.

Instead of removing it completely, there might be other ways to relief your pain. One would be an environment variable to disable the message. Another could be to only show the message once per “session”. You mention that you get it with “every matplotlib.pyplot.show()”, are these multiple calls in a single session (as in not restarting the kernel)?
I understand that in 2016, the Pyzo folks are trying to unlink the IDE from the actual Python environment, but the previous method of simply putting everything together works best for newbies
I agree that one bundle is easier to get started. However, there were several problems with that approach:
- Messing up the env (e.g. uninstalling PyQt) breaks the IDE.
- There have been several cases where seemingly simple env updates broke the IDE.
- Users are less aware of the env and what conda is.
- You cannot update your env, or your IDE without also updating the other.
- Last, but not least: it cost me a ton of extra work.

I tried to make it as smooth and clear as possible for user to install the IDE and environment. I’m happy to hear about ideas to improve things here though!

Regards,
Almar




From: Karl Rudnick
Sent: 14 November 2016 22:24
To: Pyzo
Cc: ***@gmail.com
Subject: Re: [Pyzo] Note on using QApplication.exec_():

I could not live with this annoying message so I upgraded my pyzo2014a to pyzo2015a via pyzo_distro-2015a.win64.zip at http://test.pyzo.org/downloads.html. I understand that in 2016, the Pyzo folks are trying to unlink the IDE from the actual Python environment, but the previous method of simply putting everything together works best for newbies, especially if you're holding someone's hand to convince them that they might be able to live without Matlab. At the very least, you should fully test before releasing this as a stable Matlab "equivalent." Else, people will be turned off and won't come back.

Regards,
Karl Rudnick

On Sat, Nov 12, 2016 at 4:14 PM, <***@gmail.com> wrote:
So, how can this get fixed or should we revert to earlier versions of IEP? I'm trying to walk someone through how python can replace matlab. I'm using pyzo, and this just makes things completely messy. My code worked fine in pyzo2014a. I have a ton of plotting things using matplotlib and now every matplotlib.pyplot.show() mixes this useless warning with the shell output text from all my programs. It's easy to see where this is in the IEP source. Look in iep.iepkernel.guiintegration, guiintegration.py

# Qt has its own message
mainloopWarning_qt = """
Note on using QApplication.exec_():
The GUI event loop is already running in the IEP kernel, and exec_()
does not block. In most cases your app should run fine without the need
for modifications. For clarity, this is what the IEP kernel does:
- Prevent deletion of objects in the local scope of functions leading to exec_()
- Prevent system exit right after the exec_() call
""".strip()+"\n"
Post by w***@gmail.com
If it's something I should worry about
 
No. It’s mostly to warn people who use `sys.exit(app/exec_())` and are confused about what happens.
 
 
Post by w***@gmail.com
if there is some way of suppressing it? It is getting in the way of my text output
 
Currently no. But should be easy to add. Made an issue for it: https://github.com/pyzo/pyzo/issues/418
 
Regards,
  Almar
 
 
 
Sent: 01 August 2016 12:19
To: Pyzo
 
 
 
The GUI event loop is already running in the pyzo kernel, and exec_()
does not block. In most cases your app should run fine without the need
- Prevent deletion of objects in the local scope of functions leading to exec_()
- Prevent system exit right after the exec_() call
 
 
1) If it's something I should worry about and
2) if there is some way of suppressing it? It is getting in the way of my text output
 
Thanks
 
Will
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
For more options, visit https://groups.google.com/d/optout.
 
--
You received this message because you are subscribed to a topic in the Google Groups "Pyzo" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyzo/BGLZtX1lz74/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pyzo+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyzo+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyzo+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
r***@gmail.com
2016-11-17 01:24:37 UTC
Permalink
I have some test scripts that each throw up about half a dozen plots. So I get that message every time I invoke matplotlib.pyplot.show() from within the IDE. Having that message only once per "session" would be quite an improvement. It is not my code that is causing this. I'm surprised that the event loop that matplotlib creates with the plot isn't encapsulated in a completely separate object from the IEP event loop. Is that matplotlib's "fault?" Note that when I execute any of my codes from the command line, outside of Pyzo, everything is great.

I'm not sure that completely suppressing the warning is a good idea, if there are technical reasons for it. Would be useful to ask the matploblib authors to modify their code in some way?

Thanks - Karl

On Wednesday, November 16, 2016 at 1:35:45 AM UTC-8, Almar Klein wrote:s> Dear Karl,
Post by a***@gmail.com
 
I understand that the message is annoying if it occurs multiple times. However, the fact that it is there is deliberate; it is printed when Pyzo detects that a mainloop is being started. Pyzo’s GUI integration makes such a call non-blocking, which can cause problems, which will be extremely annoying if you don’t understand the situation.
 
Instead of removing it completely, there might be other ways to relief your pain. One would be an environment variable to disable the message. Another could be to only show the message once per “session”. You mention that you get it with “every matplotlib.pyplot.show()”, are these multiple calls in a single session (as in not restarting the kernel)?
 
I understand that in 2016, the Pyzo folks are trying to unlink the IDE from the actual Python environment, but the previous method of simply putting everything together works best for newbies
 
- Messing up the env (e.g. uninstalling PyQt) breaks the IDE.
- There have been several cases where seemingly simple env updates broke the IDE.
- Users are less aware of the env and what conda is.
- You cannot update your env, or your IDE without also updating the other.
- Last, but not least: it cost me a ton of extra work.
 
I tried to make it as smooth and clear as possible for user to install the IDE and environment. I’m happy to hear about ideas to improve things here though!
 
Regards,
  Almar
 
 
 
 
From: Karl Rudnick
Sent: 14 November 2016 22:24
To: Pyzo
 
I could not live with this annoying message so I upgraded my pyzo2014a to pyzo2015a via pyzo_distro-2015a.win64.zip at http://test.pyzo.org/downloads.html. I understand that in 2016, the Pyzo folks are trying to unlink the IDE from the actual Python environment, but the previous method of simply putting everything together works best for newbies, especially if you're holding someone's hand to convince them that they might be able to live without Matlab. At the very least, you should fully test before releasing this as a stable Matlab "equivalent." Else, people will be turned off and won't come back.
 
Regards,
Karl Rudnick
 
So, how can this get fixed or should we revert to earlier versions of IEP? I'm trying to walk someone through how python can replace matlab. I'm using pyzo, and this just makes things completely messy. My code worked fine in pyzo2014a. I have a ton of plotting things using matplotlib and now every matplotlib.pyplot.show() mixes this useless warning with the shell output text from all my programs. It's easy to see where this is in the IEP source. Look in iep.iepkernel.guiintegration, guiintegration.py
# Qt has its own message
mainloopWarning_qt = """
The GUI event loop is already running in the IEP kernel, and exec_()
does not block. In most cases your app should run fine without the need
- Prevent deletion of objects in the local scope of functions leading to exec_()
- Prevent system exit right after the exec_() call
""".strip()+"\n"
Post by w***@gmail.com
If it's something I should worry about
 
No. It’s mostly to warn people who use `sys.exit(app/exec_())` and are confused about what happens.
 
 
Post by w***@gmail.com
if there is some way of suppressing it? It is getting in the way of my text output
 
Currently no. But should be easy to add. Made an issue for it: https://github.com/pyzo/pyzo/issues/418
 
Regards,
  Almar
 
 
 
Sent: 01 August 2016 12:19
To: Pyzo
 
 
 
The GUI event loop is already running in the pyzo kernel, and exec_()
does not block. In most cases your app should run fine without the need
- Prevent deletion of objects in the local scope of functions leading to exec_()
- Prevent system exit right after the exec_() call
 
 
1) If it's something I should worry about and
2) if there is some way of suppressing it? It is getting in the way of my text output
 
Thanks
 
Will
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
For more options, visit https://groups.google.com/d/optout.
 
--
You received this message because you are subscribed to a topic in the Google Groups "Pyzo" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyzo/BGLZtX1lz74/unsubscribe.
For more options, visit https://groups.google.com/d/optout.
 
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
For more options, visit https://groups.google.com/d/optout.
 
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyzo+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
a***@gmail.com
2016-11-17 10:42:00 UTC
Permalink
No, its not MPL’s fault. Its because pyplot.show() tries to enter the main loop (of whatever backend GUI toolkit it is using), as it should. The point is that Pyzo has “hijacked” this mainloop, making such a call non-blocking.

Actually, the message does not occur when you use mpl in interactive mode (because plt.show() does not enter the mainloop in that case. So putting plt.ion() at the top of your code will also get rid of the message. That is, if its your code :)

This also explains why you might not have seen this in previous versions; Older Pyzo versions (the ones with mpl bundled in) modified the mpl config to turn interactive mode on by default. (This, btw, also had some complications, e.g. updating mpl would turn it back off.)

Anyway, I just pushed a commit that makes Pyzo print the warning at most once per kernel session.

Regards,
Almar

From: ***@gmail.com
Sent: 17 November 2016 02:24
To: Pyzo
Cc: ***@gmail.com; ***@gmail.com
Subject: Re: [Pyzo] Note on using QApplication.exec_():

I have some test scripts that each throw up about half a dozen plots. So I get that message every time I invoke matplotlib.pyplot.show() from within the IDE. Having that message only once per "session" would be quite an improvement. It is not my code that is causing this. I'm surprised that the event loop that matplotlib creates with the plot isn't encapsulated in a completely separate object from the IEP event loop. Is that matplotlib's "fault?" Note that when I execute any of my codes from the command line, outside of Pyzo, everything is great.

I'm not sure that completely suppressing the warning is a good idea, if there are technical reasons for it. Would be useful to ask the matploblib authors to modify their code in some way?

Thanks - Karl

On Wednesday, November 16, 2016 at 1:35:45 AM UTC-8, Almar Klein wrote:s> Dear Karl,
Post by a***@gmail.com
 
I understand that the message is annoying if it occurs multiple times. However, the fact that it is there is deliberate; it is printed when Pyzo detects that a mainloop is being started. Pyzo’s GUI integration makes such a call non-blocking, which can cause problems, which will be extremely annoying if you don’t understand the situation.
 
Instead of removing it completely, there might be other ways to relief your pain. One would be an environment variable to disable the message. Another could be to only show the message once per “session”. You mention that you get it with “every matplotlib.pyplot.show()”, are these multiple calls in a single session (as in not restarting the kernel)?
 
I understand that in 2016, the Pyzo folks are trying to unlink the IDE from the actual Python environment, but the previous method of simply putting everything together works best for newbies
 
- Messing up the env (e.g. uninstalling PyQt) breaks the IDE.
- There have been several cases where seemingly simple env updates broke the IDE.
- Users are less aware of the env and what conda is.
- You cannot update your env, or your IDE without also updating the other.
- Last, but not least: it cost me a ton of extra work.
 
I tried to make it as smooth and clear as possible for user to install the IDE and environment. I’m happy to hear about ideas to improve things here though!
 
Regards,
  Almar
 
 
 
 
From: Karl Rudnick
Sent: 14 November 2016 22:24
To: Pyzo
 
I could not live with this annoying message so I upgraded my pyzo2014a to pyzo2015a via pyzo_distro-2015a.win64.zip at http://test.pyzo.org/downloads.html. I understand that in 2016, the Pyzo folks are trying to unlink the IDE from the actual Python environment, but the previous method of simply putting everything together works best for newbies, especially if you're holding someone's hand to convince them that they might be able to live without Matlab. At the very least, you should fully test before releasing this as a stable Matlab "equivalent." Else, people will be turned off and won't come back.
 
Regards,
Karl Rudnick
 
So, how can this get fixed or should we revert to earlier versions of IEP? I'm trying to walk someone through how python can replace matlab. I'm using pyzo, and this just makes things completely messy. My code worked fine in pyzo2014a. I have a ton of plotting things using matplotlib and now every matplotlib.pyplot.show() mixes this useless warning with the shell output text from all my programs. It's easy to see where this is in the IEP source. Look in iep.iepkernel.guiintegration, guiintegration.py
# Qt has its own message
mainloopWarning_qt = """
The GUI event loop is already running in the IEP kernel, and exec_()
does not block. In most cases your app should run fine without the need
- Prevent deletion of objects in the local scope of functions leading to exec_()
- Prevent system exit right after the exec_() call
""".strip()+"\n"
Post by w***@gmail.com
If it's something I should worry about
 
No. It’s mostly to warn people who use `sys.exit(app/exec_())` and are confused about what happens.
 
 
Post by w***@gmail.com
if there is some way of suppressing it? It is getting in the way of my text output
 
Currently no. But should be easy to add. Made an issue for it: https://github.com/pyzo/pyzo/issues/418
 
Regards,
  Almar
 
 
 
Sent: 01 August 2016 12:19
To: Pyzo
 
 
 
The GUI event loop is already running in the pyzo kernel, and exec_()
does not block. In most cases your app should run fine without the need
- Prevent deletion of objects in the local scope of functions leading to exec_()
- Prevent system exit right after the exec_() call
 
 
1) If it's something I should worry about and
2) if there is some way of suppressing it? It is getting in the way of my text output
 
Thanks
 
Will
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
For more options, visit https://groups.google.com/d/optout.
 
--
You received this message because you are subscribed to a topic in the Google Groups "Pyzo" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyzo/BGLZtX1lz74/unsubscribe.
For more options, visit https://groups.google.com/d/optout.
 
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
For more options, visit https://groups.google.com/d/optout.
 
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyzo+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyzo+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...