First test program fails - There is no current event loop in thread 3

716 views
Skip to first unread message

John Mycroft

unread,
Jul 28, 2017, 5:39:13 PM7/28/17
to VPython-users
I have just installed vpython (and --upgrade) on a Windows 10 laptop.  My first simple program :-
from vpython import *
box()
fails consistently with many error message lines that finish with
  File "C:\Python35\lib\asyncio\tasks.py", line 538, in ensure_future
    loop = events.get_event_loop()
  File "C:\Python35\lib\asyncio\events.py", line 626, in get_event_loop
    return get_event_loop_policy().get_event_loop()
  File "C:\Python35\lib\asyncio\events.py", line 572, in get_event_loop
    % threading.current_thread().name)
RuntimeError: There is no current event loop in thread 'Thread-3'.

I have vpython in my site-packages folder and as far as I can figure installation was 100% successful.  Any help ratefully accpted.  I did try running that test program directly on the glowscript.org website and it worked fine.

Cheers - John

Craig Wiegert

unread,
Jul 29, 2017, 1:07:55 PM7/29/17
to vpytho...@googlegroups.com
Hi John,

What version of python 3 do you have installed on your laptop? I ran
into similar error messages with python 3.5.2, but updating to python
3.5.3 (or 3.6.x) seemed to fix the problem for me.

Cheers,

- Craig
> --
> You received this message because you are subscribed to the Google
> Groups "VPython-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to vpython-user...@googlegroups.com
> <mailto:vpython-user...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

--
----------------------------------------------------------------------
Craig Wiegert Office: 215 Physics Building
Undergraduate Physics Coordinator
Associate Professor Phone: 706-542-4023
Department of Physics & Astronomy Fax: 706-542-2492
University of Georgia Email: wie...@physast.uga.edu
Athens, GA 30602-2451 cwie...@uga.edu

John Mycroft

unread,
Jul 31, 2017, 11:35:17 AM7/31/17
to VPython-users
Hi, Craig

Yup - that did it - I upgraded to 3.6.2 and re-installed numpy (because of an error message) and I now have what looks like a working vpython.  Thanks for your help.  Incidentally, I plan to use vpython on my "tutorial day" (one day in five) of the intro Python course I teach in high school.  The first 4 periods of the week are spent teaching the syntax and all that boring stuff and the tutorial period is a kind of sandbox day where we go over tips & tricks, questions that need more than a quick 2 minute answer, experimenting time and so on.  (My principal calls this period "unprofessional").  vpython will fit in there very nicely.

Cheers - John

Bruce Sherwood

unread,
Jul 31, 2017, 12:10:06 PM7/31/17
to VPython-users
As a result of this useful exchange I've changed the instructions at vpython.org to say the following about Python 3.5 (I had happened to test only with 3.5.3 and failed to notice the problem with 3.5.2):


You can run from IDLE or Spyder with Python 3.5 (3.5.3 or greater) or 3.6
. You can start Spyder from a command prompt by typing "spyder", but you also have to go to Run > Configure and specify "Execute in a new dedicated Python console". Some Mac users have reported that running from IDLE or Spyder doesn't work, and the cause is under study. The following workaround, making and invoking a new environment, does work:

      conda create -n vpclean -c vpython vpython python=3
      source activate vpclean


Issue with Spyder: There is a 
new Spyder 3.2 that may not support the use of vpython. The Spyder developers are aware of the issue and have offered to address the problem.

Reply all
Reply to author
Forward
0 new messages